How to Format Excel Times with Milliseconds
Question details
The user is trying to display four decimal places for milliseconds in Excel, but the application rejects the custom format code hh:mm:ss.0000.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Applying a custom time format to imported data that contains four or more fractional-second digits.
- Observed behavior
- Excel rejects the hh:mm:ss.0000 format. The application restricts time format displays to a maximum of three decimal places, and the formatting may also fail if the system's regional settings use a different decimal separator.
Verify your computer's regional settings to determine whether your system uses a period (.) or a comma (,) as the default decimal separator, as this affects how custom number formats are read.
Use the Standard 3-Digit Millisecond Format
Apply the maximum supported decimal precision for time in Excel to successfully format your cells.
Excel is hardcoded to support only up to three decimal places for milliseconds in its time formatting. Even if your imported data contains four or more fractional-second digits, Excel will round the displayed time to three digits.
Attempting to force four digits (like hh:mm:ss.0000) will result in an invalid format error. Using the correct three-digit format resolves the rejection issue while maintaining the highest visual precision Excel allows.
Highlight the cells, rows, or columns containing the time data you want to format.
Right-click the selected cells and choose 'Format Cells' from the context menu, or press the shortcut Ctrl + 1.
In the 'Number' tab, select 'Custom' from the Category list on the left side.
In the 'Type' input box, type exactly h:mm:ss.000 and click 'OK' to apply the format.

Adjust Format Code for Regional Settings
Modify the decimal separator in your custom format if the standard h:mm:ss.000 format is also rejected.
Disable Text-Formatting Error Checks
Prevent Excel from flagging imported text-based time data as errors if you choose to keep the imported format as text.
Manage Custom Time Formats Seamlessly with WPS Spreadsheet
WPS Spreadsheet offers robust and intuitive cell formatting features, allowing you to easily display milliseconds and manage high-precision data with full support for standard custom formatting codes.
- 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your time data.
- 2. Select the time cells: Highlight the cells or the entire column that contains the time values you want to format.
- 3. Open Format Cells: Right-click the selected area and choose 'Format Cells' from the context menu, or press Ctrl+1.
- 4. Apply custom format: Navigate to the 'Custom' category in the Number tab, enter 'h:mm:ss.000' in the Type box, and click OK.

Frequently Asked Questions
Can I force Excel to display four digits of milliseconds?
No, Excel inherently restricts time format displays to a maximum of three decimal places (milliseconds). If you need to visibly show four decimal places, the data must be formatted and stored as Text rather than a recognizable Time value.
Why does Excel reject the h:mm:ss.000 format code?
If the correct three-digit format is rejected, it usually means your operating system's regional settings use a comma as the decimal separator instead of a period. Try entering h:mm:ss,000 instead.
Will I lose my data precision if Excel rounds the display to three digits?
No. Excel imports and stores the underlying fractional seconds with higher precision even if it only displays up to three digits. Any mathematical calculations performed on those cells will still use the exact stored value.




