new-date
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/new-date package

1.0.3 • Public • Published

new-date

CircleCI Codecov

Create a new Date, accepting more input types than normal, like Unix timestamps.

Installation

$ npm install new-date

API

newDate(Date|String|Number)

Returns a new Date object created from the input. The input can be:

  • Date objects
  • date strings
  • millisecond numbers
  • second numbers
  • millisecond strings
  • second strings
var newDate = require('new-date');

newDate(new Date);
newDate('Wed, 09 Aug 1995 00:00:00 GMT');
newDate('Aug 9, 1995');
newDate('2011-10-10T14:48:00');
newDate(1363288923637);
newDate(1363288923);
newDate('1363288923637');
newDate('1363288923');

/new-date/

    Package Sidebar

    Install

    npm i new-date

    Weekly Downloads

    517,533

    Version

    1.0.3

    License

    SEE LICENSE IN LICENSE

    Unpacked Size

    12.8 kB

    Total Files

    13

    Last publish

    Collaborators

    • segment-admin