Socket
Socket
Sign inDemoInstall

new-date

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    new-date

Creates a new Date, but accepts a few more input types than normal.


Version published
Weekly downloads
505K
decreased by-22.13%
Maintainers
1
Install size
23.3 kB
Created
Weekly downloads
 

Readme

Source

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');

Keywords

FAQs

Last updated on 25 May 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc