agm-dateformat
v1.0.6
Published
A simple date formatting library
Downloads
6
Maintainers
Readme
agm-dateformat
agm-dateformat is a simple utility for formatting dates in various formats
Installation
Install the package using npm:
npm install agm-dateformat
USAGE
import agmFormatDate from 'agm-dateformat';
agmFormatDate("2024-09-01T10:00:00Z","dd-mm-yyyy"); // 01-09-2024 is the output
agmFormatDate(new Date('2024-09-17T10:30:00Z'), "mmm dd"); //Sept-01 is the output
| suported date formats |
|------------------------------------------|
| 2024-09-01T10:00:00Z
|
| Tue, 17 Sep 2024 10:30:00 +0000
|
| new Date('2024-09-17T10:30:00Z')
|
| 2024-09-17
|
FROMATS
| formats | demo outputs |
|------------------------------------------|------------------------|
| dd-mm-yyyy
| 01-09-2024 |
| dd/mm/yyyy
| 01/09/2024 |
| dd mmm yyyy
| 01 Sep 2024 |
| mmm dd yyyy
| September 01 2024 |
| ddd tt
| Sun 10:00 AM |
| mmm dd
| May-12 |
| dddd dd mmm yyyy
| Friday, 12 May 2023 |
| dd-mm-yy
| 20-12-22 |
| dd/mm/yy
| 20/12/22 |
| dd/mm/yyyy tt
| 22-02-2020 10:30 PM |
| dd-mm-yyyy tt
| 22-02-2020 12:00 AM |
will add new formats in upcoming versions