https://github.com/tschoffelen/is-iso-date-string
Checks if a string is a valid ISO 8601 date string.
https://github.com/tschoffelen/is-iso-date-string
Last synced: 14 days ago
JSON representation
Checks if a string is a valid ISO 8601 date string.
- Host: GitHub
- URL: https://github.com/tschoffelen/is-iso-date-string
- Owner: tschoffelen
- License: mit
- Created: 2024-09-03T07:44:26.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-03T07:44:28.000Z (9 months ago)
- Last Synced: 2025-04-30T14:58:58.148Z (24 days ago)
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-iso-date-string
Checks if a string is a valid [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations)
date string.## Installation
Run `yarn add is-iso-date-string`, or `npm i is-iso-date-string` if you insist.
## Usage
```js
const isIsoDateString = require("is-iso-date-string");isIsoDateString("2024-09-03T08:39:01+01:00"); // true
isIsoDateString("2024-09-03"); // true
isIsoDateString("03-09-2024 08:39:01"); // false
```