CLDR SSS
Fractional seconds.
000
at the reference instant, Mon, Jan 2 2006, 3:04:05 PM MST
Sub-second digits. Precision is where languages diverge: CLDR S counts decimal places, Python %f is always six digits (microseconds), Go .000 prints exactly the zeros you write, chrono %f is nanoseconds. Never assume three digits.
| Language | Token | Caveat |
|---|---|---|
| C# custom format | fff | Each f is one digit, up to fffffff (100 ns); uppercase F trims trailing zeros instead of printing them. |
| CLDR / ICU pattern | S | Prints exactly as many decimal places as you write letters, truncating: SSS is milliseconds, SSSSSS microseconds. |
| Go time layout | .000 | Prints exactly as many digits as you write zeros; .999 trims trailing zeros instead. |
| Java DateTimeFormatter | SSS | One S per digit, up to nine (nanoseconds); the value is truncated, not rounded. n prints raw nano-of-second. |
| JavaScript Intl.DateTimeFormat | fractionalSecondDigits: 3 | Accepts 1–3 only; digits beyond three are truncated, never rounded to more. |
| Moment.js format | SSS | S/SS/SSS print one to three digits; SSSS and beyond just pad the three significant digits with zeros. |
| PHP date() | v | Exactly three digits (milliseconds); u gives six (microseconds). Real digits require a DateTime object — date() always prints zeros. |
| Python strftime | %f | Always six digits (microseconds), never three. |
| Ruby strftime | %L | Milliseconds, exactly three digits. %N is nanoseconds (nine digits) and takes a width: %6N for microseconds. |
| Rust chrono | %.3f | Milliseconds including the leading dot (.026); %.6f and %.9f fix other widths, %3f drops the dot. Bare %f is a trap — nanoseconds as an unscaled number. |
Definition anchored to Unicode UTS #35 — Date Field Symbol Table.