DateTime Formatter
Preview what DateTime.ToString(format) returns in .NET for any date, format string and culture.
Custom format
Standard formats
| Format | Name | Result |
|---|
Common patterns
| Format | Use | Result |
|---|
Individual components
| Format | Component | Result |
|---|
Format specifier reference
| Specifier | Meaning | Example |
|---|
About this tool
The formatter is a JavaScript re-implementation of .NET's DateTime format rules. Click any format in the tables to load it into the custom box.
- A single character is a standard format (for example
doro). Use%dto get the custom day specifier on its own. - Text in single or double quotes is copied literally, and
\escapes one character./and:become the culture's date and time separators. - Month and day names and AM/PM designators come from your browser's locale data (ICU). Culture patterns (
d,D,t…) were checked against .NET 10 on ICU, which is what .NET uses on Linux, macOS and Windows 10+. Results depend on the ICU version of both your browser and the .NET runtime, so separators (for example U+202F before AM/PM in en-US) and abbreviations can differ slightly; Windows with the legacy NLS mode differs more. - Kind mirrors
DateTimeKind: it changesK,zand theUformat. Like real .NET,Randudo not convert aDateTimeto UTC; callToUniversalTime()first. - Browser date inputs carry milliseconds only, so the 4th to 7th fraction digits (
ffff…) are always zero.
Privacy
Everything is computed in your browser. Nothing is sent, stored or logged.