user-friendly-date-formatter

2.0.0 • Public • Published

user-friendly-date-formatter

Display the date and time in a simple, user-friendly way.

Usage

Install the package...

$ npm i user-friendly-date-formatter

...then...

const df = require('user-friendly-date-formatter'); // or import df from 'user-friendly-date-formatter'
 
const userFriendlyDate = df(new Date(1159066423330), '%fM %D, %YYYY at %h:%m %a');
console.log(userFriendlyDate);
// -> Sep 23, 2006 at 9:53 pm

API

Year

  • %YYYY
  • %YY

Month

  • %fMM
  • %fM
  • %MM
  • %M

Date

  • %DD
  • %D

Day

  • %ddd
  • %dd
  • %d

Hour

  • %H
  • %h

Minute

  • %m

Second

  • %s

Millisecond

  • %l
  • %t

Suffix

  • %a

Hope this package helps you!

Found a bug? Open an issue or ping me on Discord: Vehmloewff#0714.

Package Sidebar

Install

npm i user-friendly-date-formatter

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

6.14 kB

Total Files

5

Last publish

Collaborators

  • vehmloewff