iso-date
v1.0.0
Published
Get a ISO date string, i.e. 'YYYY-MM-DD', from a Date
Downloads
275
Maintainers
Readme
iso-date
Get a ISO date string, i.e. 'YYYY-MM-DD', from a Date
Installation
Install iso-date
using npm:
npm install --save iso-date
Usage
Module usage
var isoDate = require('iso-date');
isoDate('2011-11-11 11:11:11');
// "2011-11-11"
isoDate(1444047247887);
// "2015-10-05"
isoDate();
// todays date, e.g: "2015-10-05"
isoDate(new Date());
// todays date, e.g: "2015-10-05"
API
isoDate(date)
| Name | Type | Description |
|------|------|-------------|
| date | String|Number|Date|undefined
| The date to get an ISO date from |
Returns: String
, a date string on the format "YYYY-MM-DD".
License
MIT © Joakim Carlstein