date_different_format_ethar
v1.1.0
Published
This is a package for date formatting. Developer - Mohammed Ethar
Downloads
19
Maintainers
Readme
Date different formatting system
This is a package for date formatting. Developer - Mohammed Ethar
Installation
To download this package, first you need node.js If ES6, in package.json type: module
$ npm i date_different_format_ethar
Use case
import { formatDate_ethar } from 'date_different_format_ethar';
// Example usage
const date = '2024-06-02';
console.log('YYYY-MM-DD:', formatDate_ethar(date, 'YYYY-MM-DD')); //output:: 2024-06-02
console.log('MM/DD/YYYY:', formatDate_ethar(date, 'MM/DD/YYYY')); //output:: 06/01/2024
console.log('DD/MM/YYYY:', formatDate_ethar(date, 'DD/MM/YYYY')); //output:: 01/06/2024
console.log('long:', formatDate_ethar(date, 'long')); //output:: June 1, 2024
console.log('short:', formatDate_ethar(date, 'short')); //output:: Jun 1, 24
console.log('full:', formatDate_ethar(date, 'full')); //output:: Saturday, June 1, 2024
console.log('medium:', formatDate_ethar(date, 'medium')); //output:: Jun 1, 2024