1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

Fixed month reference in documented output of parseDate and parseDateTime function calls (#3859)

This commit is contained in:
Chris Knight 2020-02-02 21:46:05 +00:00 committed by GitHub
parent 4f8a5c0239
commit 77f4df40f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,12 +14,12 @@ Simple helper to help parse date strings into `Date`, with additional functions.
```ts
import { parseDate, parseDateTime } from 'https://deno.land/std/datetime/mod.ts'
parseDate("03-01-2019", "dd-mm-yyyy") // output : new Date(2019, 1, 3)
parseDate("2019-01-03", "yyyy-mm-dd") // output : new Date(2019, 1, 3)
parseDate("20-01-2019", "dd-mm-yyyy") // output : new Date(2019, 0, 20)
parseDate("2019-01-20", "yyyy-mm-dd") // output : new Date(2019, 0, 20)
...
parseDateTime("01-03-2019 16:34", "mm-dd-yyyy hh:mm") // output : new Date(2019, 1, 3, 16, 34)
parseDateTime("16:34 01-03-2019", "hh:mm mm-dd-yyyy") // output : new Date(2019, 1, 3, 16, 34)
parseDateTime("01-20-2019 16:34", "mm-dd-yyyy hh:mm") // output : new Date(2019, 0, 20, 16, 34)
parseDateTime("16:34 01-20-2019", "hh:mm mm-dd-yyyy") // output : new Date(2019, 0, 20, 16, 34)
...
```