← Back to release summary

fractionalSecondDigits option for Intl.DateTimeFormat

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 84)
Intent stage
Prepare to ship

Summary

Enhances the Intl.DateTimeFormat API by adding a “ fractionalSecondDigits” option to control the format of fractions of a second.

Motivation

The Date object in ECMAScript stores time information with millisecond precision. Some web developers need to output milliseconds. This option enhances Intl.DateTimeFormat to control formatting of fractions of second. The value of millisecondDigits should be an integer between 0 to 3 to represent how many digits the DateTimeFormat should output after the decimal mark.

Standards & signals

Docs: https://docs.google.com/document/d/1KXbFOzTsfIHXhk0uw8p8WXIHZ1Bm1xMZXahtDOiK40Q/edit#

Samples: https://docs.google.com/document/d/1KXbFOzTsfIHXhk0uw8p8WXIHZ1Bm1xMZXahtDOiK40Q/edit#

Explainers: https://docs.google.com/document/d/1KXbFOzTsfIHXhk0uw8p8WXIHZ1Bm1xMZXahtDOiK40Q/edit#

View on chromestatus.com