Dateformat

dateformat

Steven Levithan's excellent dateFormat() function.

Installation

1
$ npm install dateformat

Usage

1
2
3
4
5
6
7
8
9
10
11
12
var dateFormat = require('dateformat');
var now = new Date();

dateFormat(now, "dddd, mmmm dS, yyyy, h:MM:ss TT");

dateFormat(now, "isoDateTime");

dateFormat.masks.foodTime = 'HH:MM! "Time to eat!"';

dateFormat(now, "foodTime");

dateFormat("Feb 1 1988", "fullDate");

GIF FTW:

Thanks to the author Felix Geisendörfer for a sweet date formatter! :)

Suggest a module

Comments