2.0.0 • Published 5 years ago

user-friendly-date-formatter v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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.