Export a timestamp with milliseconds

Turn 11/4/2026 2:30:15.123 PM into the text 2026-11-04T14:30:15.123 for an import.

What you'll make

In Excel: 11/4/2026 2:30:15.123 PM becomes 2026-11-04T14:30:15.123.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8The real date and time.11/4/2026 2:30:15.123 PM
2"yyyy-mm-ddWrites the date as year, month, day."2026-11-04"
3""T""Adds a capital T between date and time."2026-11-04T"
4hh:mm:ss.000"Adds 24-hour time with three digits after the seconds."…T14:30:15.123"
5TEXT( … )Writes the date and time in that pattern as text."…T14:30:15.123"

Parts 2 to 4 are one pattern. The doubled quotes keep T as a plain letter.

=TEXT(A8,"yyyy-mm-dd""T""hh:mm:ss.000")

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up examples with the formula already in.
  2. Use your own dates and times. Paste real dates and times into the green column of the Template tab. The timestamp text fills in by itself.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

The text has no time zone. Add Z only if the times are already UTC; it doesn't convert them.

Microsoft's help: TEXT function