Adding DateTime::ToString(fmt) formatting
@@ -1 +0,0 @@
|
||||
| Code | What it does | Example |
|
||||
30
DateTime_ToString_Formating.md
Normal file
30
DateTime_ToString_Formating.md
Normal file
@@ -0,0 +1,30 @@
|
||||
Supported DateTime format strings
|
||||
=================================
|
||||
| Code | Description | Example |
|
||||
|------|-------------|---------|
|
||||
| `%a` | Abbreviated weekday name | `Tue` |
|
||||
| `%A` | Full weekday name | `Tuesday` |
|
||||
| `%h` / `%b` | Abbreviated month name | `Sep` |
|
||||
| `%B` | Full month name | `September` |
|
||||
| `%C` | Century (year / 100) | `20` |
|
||||
| `%y` | Year, two digits, zero-padded | `26` |
|
||||
| `%Y` | Year, four digits | `2026` |
|
||||
| `%m` | Month, zero-padded | `09` |
|
||||
| `%d` | Day of month, zero-padded | `01` |
|
||||
| `%e` | Day of month, space-padded | ` 1` |
|
||||
| `%H` | Hour (24h), zero-padded | `13` |
|
||||
| `%I` | Hour (12h), zero-padded | `01` |
|
||||
| `%M` | Minute, zero-padded | `07` |
|
||||
| `%S` | Second, zero-padded | `05` |
|
||||
| `%p` | AM or PM | `PM` |
|
||||
| `%r` | 12h time (`%I:%M:%S %p`) | `01:07:05 PM` |
|
||||
| `%R` | 24h time, hours + minutes | `13:07` |
|
||||
| `%T` | 24h time, full | `13:07:05` |
|
||||
| `%F` | Date (`%Y-%m-%d`) | `2026-09-01` |
|
||||
| `%D` | Date (`%m/%d/%y`) | `09/01/26` |
|
||||
| `%u` | Day of week, **Mon=1 … Sun=7** (ISO 8601) | `2` |
|
||||
| `%w` | Day of week, **Sun=0 … Sat=6** | `2` |
|
||||
| `%c` | Locale-preferred date + time | `Tue Sep 1 13:07:05 2026` |
|
||||
| `%%` | Literal `%` | `%` |
|
||||
| `%n` | Newline | `\n` |
|
||||
| `%t` | Tab | `\t` |
|
||||
Reference in New Issue
Block a user