Skip to content

azer/format-date

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

format-date

Takes a string and a date object, returns what you expect

Example:

var formatDate = require('format-date')

formatDate('{month}/{day}/{year}', new Date);
// => 21/09/2014

formatDate('{hours}:{minutes}:{seconds} {day-name}', new Date);
// => 13:30:53 Monday

formatDate('{month-name} {year}', new Date)
// => January 2014

Install

$ npm install format-date

Reference

  • day
  • day-name
  • month
  • month-name
  • year
  • hours
  • minutes
  • seconds

About

Takes a string and a date object, returns what you expect

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published