
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
datetime-formatter
Advanced tools
This package is intended to format datetime to different desirable formats for users and businesses.
This package is intended to simplify the process of converting datetime to the required format as desired by users and businesses. We've developed this package as a result of facing the same obstable that faces many developers in which JS does not provide desirable formats for datetime strings. Which is so bizzare, I still don't get it. But, anyway!
formatDateTime(date, format); -date: This is the datetime you want to get formatted. (note: if you don't pass this, the function takes current datetime as default);
-format: This is the format that you need to convert your datetime to. Acceptable formats are : 'MM/DD/YYYY' 'MM/DD/YYYY HH:mm:ss' 'MM/DD/YYYY HH:mm' 'MM/DD/YYYY HH:mm:ss.sss' 'MM-DD-YYYY' 'MM-DD-YYYY HH:mm:ss' 'MM-DD-YYYY HH:mm' 'MM-DD-YYYY HH:mm:ss.sss'
Note: if you pass the letter 'a' to any of the above formats that have time in it, it will return the time in AM/PM format. Otherwise, it'd default to 24 hour format.
Simple usage of this package is as following:
var datetime_formatter = require('datetime-formatter'); var formattedDateTime = datetime_formatter.formatDateTime(null, 'MM/DD/YYYY');
the result would be: 09/28/2017
Or you can pass your own datetime to be formatted: var datetime_formatter = require('datetime-formatter'); var formattedDateTime = datetime_formatter.formatDateTime(null, 'MM-DD-YYYY HH:mm:ss a');
Result would look like: 09-28-2017 03:47:20 PM
You can also pass your own datetime to format: var datetime_formatter = require('datetime-formatter'); var formattedDateTime = datetime_formatter.formatDateTime'09-28-2017 03:47:20 PM', 'MM/DD/YYYY HH:mm:ss');
Would result in: 09/28/2017 15:47:20
Enjoy!
FAQs
This package is intended to format datetime to different desirable formats for users and businesses.
We found that datetime-formatter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.