Date tokens¶
Both the from and to arguments of DATE_CONVERT use the same token set.
| Token | Meaning | Example |
|---|---|---|
YYYY |
4-digit year | 2026 |
YY |
2-digit year (00–69 → 2000s, 70–99 → 1900s) | 26 |
MM |
2-digit month (01–12) | 03 |
M |
1–2 digit month | 3 |
MMMM |
Full month name | March |
MMM |
3-char month abbreviation | Mar |
DD |
2-digit day (01–31) | 07 |
D |
1–2 digit day | 7 |
hh |
2-digit hour, 24h (00–23) | 14 |
h |
1–2 digit hour, 24h | 14 |
ii |
2-digit hour, 12h (01–12) | 02 |
i |
1–2 digit hour, 12h | 2 |
mm |
2-digit minute | 05 |
m |
1–2 digit minute | 5 |
ss |
2-digit second | 09 |
s |
1–2 digit second | 9 |
A |
AM/PM uppercase | PM |
a |
am/pm lowercase | pm |
ZZ |
UTC offset ±HH:MM (parses a literal Z as +00:00) | +02:00 |
EEEE |
Full day name | Monday |
EEE/EE/E |
Short day name | Mon |
e |
Day of week as number (1 = Mon … 7 = Sun) | 1 |
[text] |
Literal text (escaped inside format string) | [T] → T |
[*] |
Wildcard — skip until the next token | skips Z, timezone suffix |