# new-date

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

Latest version **1.0.3** (published 2021-05-25) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install new-date
pnpm add new-date
yarn add new-date
bun add new-date
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-05-25 |
| First published | 2013-06-24 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | separate (@types/new-date) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Segment |
| Maintainers | segment-admin |
| Keywords | new, date, new-date |

## Links

- npm: https://www.npmjs.com/package/new-date
- Repository: https://github.com/segmentio/new-date
- Homepage: https://github.com/segmentio/new-date#readme
- Issues: https://github.com/segmentio/new-date/issues
- npm.io page: https://npm.io/package/new-date

## Dependencies (1)

- [@segment/isodate](https://npm.io/package/@segment/isodate.md) 1.0.3

## Recent versions

- 1.0.3 (latest) — 2021-05-25
- 1.0.2 — 2021-05-19
- 1.0.1 — 2016-09-12
- 1.0.0 — 2016-05-12
- 0.2.0 — 2013-10-04
- 0.1.2 — 2013-09-02
- 0.1.1 — 2013-06-24
- 0.1.0 — 2013-06-24
- 0.0.2 — 2013-06-24

## README

# new-date

[![CircleCI](https://circleci.com/gh/segmentio/new-date.svg?style=shield&circle-token=060f74f7f82f891aef44686435bdb632d968fb20)](https://circleci.com/gh/segmentio/new-date)
[![Codecov](https://img.shields.io/codecov/c/github/segmentio/new-date/master.svg?maxAge=2592000)](https://codecov.io/gh/segmentio/new-date)

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

## Installation

```js
$ 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](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/parse)
* millisecond numbers
* second numbers
* millisecond strings
* second strings

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

---
_Source: https://npm.io/package/new-date · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
