DateTime Formatter

Preview what DateTime.ToString(format) returns in .NET for any date, format string and culture.

Custom format
Standard formats
FormatNameResult
Common patterns
FormatUseResult
Individual components
FormatComponentResult
Format specifier reference
SpecifierMeaningExample

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 d or o). Use %d to 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 changes K, z and the U format. Like real .NET, R and u do not convert a DateTime to UTC; call ToUniversalTime() 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.