# is-datestring

> Check if a string is a datetime string.

Latest version **1.0.1** (published 2017-02-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-datestring
pnpm add is-datestring
yarn add is-datestring
bun add is-datestring
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-02-13 |
| First published | 2015-09-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Michael Wuergler |
| Maintainers | radiovisual |
| Keywords | is, time, string, date, verify, boolean, timestring, datestring |

## Links

- npm: https://www.npmjs.com/package/is-datestring
- Repository: https://github.com/radiovisual/is-datestring
- Homepage: https://github.com/radiovisual/is-datestring#readme
- Issues: https://github.com/radiovisual/is-datestring/issues
- npm.io page: https://npm.io/package/is-datestring

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-02-13
- 1.0.0 — 2015-09-09

## README

# is-datestring

> Check if a string is a datetime string

[![Build Status](https://travis-ci.org/radiovisual/is-datestring.svg)](https://travis-ci.org/radiovisual/is-datestring)

:boom: **Be aware of some [quirks](https://github.com/radiovisual/is-datestring/issues).
Use at your own risk**. Pull requests welcome if you would like to
help close [issues](https://github.com/radiovisual/is-datestring/issues) on this module.


## Install

```
$ npm install --save is-datestring
```

## Usage

```js
var isDateString = require('is-datestring');

isDateString('Wednesday March 25 2015');
// => true

isDateString('Wed Sep 09 2015 23:11:46 GMT+0100 (WEST)');
// => true

isDateString('2016-12-30T08:00:00.000Z');
// => true

isDateString('1/1/2015');
// => true

isDateString('Regular String');
// => false

isDateString({});
// => false
```

## Supported Formats

Currently, this module considers the following formats to be **datestrings**:

- `2015-03-25`
- `2015-03-25`
- `1/1/2015`
- `Mar 25 2015`
- `25 Mar 2015`
- `Wednesday March 25 2015`
- `Wed Sep 09 2015 23:11:46 GMT+0100 (WEST)`
- `2016-12-30T08:00:00.000Z`

Other formats are likely to be supported, but this module only tests for the
formats listed above. **Pull requests are welcome** if you would like to add test
coverage for additional formats.

## Known Issues

- **Allows Strange Values:** This module uses JavaScript `Date()` constructor to
help determine if a string is a valid datestring. Because of this, the module is
suceptible to certain JavaScript quirks, and sometimes it lets some unassuming dateString values
pass as valid datestrings. See [Issue #2](https://github.com/radiovisual/is-datestring/issues/2)
for more information.

## License

MIT @ [Michael Wuergler](http://www.numetriclabs.com)

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