Skip to content

Commit

Permalink
Merge pull request JuliaLang#46027 from JuliaLang/LilithHafner-patch-1
Browse files Browse the repository at this point in the history
Document `y` vs `Y` in dateformat
  • Loading branch information
quinnj committed Jul 16, 2022
2 parents 9357792 + 3a15c2b commit 2024a7f
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions stdlib/Dates/src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,23 +356,23 @@ Construct a date formatting object that can be used for parsing date strings or
formatting a date object as a string. The following character codes can be used to construct the `format`
string:
| Code | Matches | Comment |
|:-----------|:----------|:-------------------------------------------------------------|
| `y` | 1996, 96 | Returns year of 1996, 0096 |
| `Y` | 1996, 96 | Returns year of 1996, 0096. Equivalent to `y` |
| `m` | 1, 01 | Matches 1 or 2-digit months |
| `u` | Jan | Matches abbreviated months according to the `locale` keyword |
| `U` | January | Matches full month names according to the `locale` keyword |
| `d` | 1, 01 | Matches 1 or 2-digit days |
| `H` | 00 | Matches hours (24-hour clock) |
| `I` | 00 | For outputting hours with 12-hour clock |
| `M` | 00 | Matches minutes |
| `S` | 00 | Matches seconds |
| `s` | .500 | Matches milliseconds |
| `e` | Mon, Tues | Matches abbreviated days of the week |
| `E` | Monday | Matches full name days of the week |
| `p` | AM | Matches AM/PM (case-insensitive) |
| `yyyymmdd` | 19960101 | Matches fixed-width year, month, and day |
| Code | Matches | Comment |
|:-----------|:----------|:--------------------------------------------------------------|
| `Y` | 1996, 96 | Returns year of 1996, 0096 |
| `y` | 1996, 96 | Same as `Y` on `parse` but discards excess digits on `format` |
| `m` | 1, 01 | Matches 1 or 2-digit months |
| `u` | Jan | Matches abbreviated months according to the `locale` keyword |
| `U` | January | Matches full month names according to the `locale` keyword |
| `d` | 1, 01 | Matches 1 or 2-digit days |
| `H` | 00 | Matches hours (24-hour clock) |
| `I` | 00 | For outputting hours with 12-hour clock |
| `M` | 00 | Matches minutes |
| `S` | 00 | Matches seconds |
| `s` | .500 | Matches milliseconds |
| `e` | Mon, Tues | Matches abbreviated days of the week |
| `E` | Monday | Matches full name days of the week |
| `p` | AM | Matches AM/PM (case-insensitive) |
| `yyyymmdd` | 19960101 | Matches fixed-width year, month, and day |
Characters not listed above are normally treated as delimiters between date and time slots.
For example a `dt` string of "1996-01-15T00:00:00.0" would have a `format` string like
Expand Down

0 comments on commit 2024a7f

Please sign in to comment.