@types/new-date
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Installation

npm install --save @types/new-date

Summary

This package contains type definitions for new-date (https://github.com/segmentio/new-date#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/new-date.

index.d.ts

export = newDate;

/**
 * Returns a new Date object created from the input. The input can be:
 * - Date objects
 * - [date strings](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/parse)
 * - millisecond numbers
 * - second numbers
 * - millisecond strings
 * - second strings
 *
 * @example
 * import 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');
 */
declare function newDate(val: Date | string | number): Date;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by BendingBender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/new-date

Weekly Downloads

33

Version

1.0.2

License

MIT

Unpacked Size

3.89 kB

Total Files

5

Last publish

Collaborators

  • types