How to convert an ISO 8601 timestamp to a date and time in Excel
Formula (Excel and Google Sheets)
=DATEVALUE(LEFT(A2,10))+TIMEVALUE(MID(A2,12,8))Convert the date and time parts and add them: =DATEVALUE(LEFT(A2,10))+TIMEVALUE(MID(A2,12,8)).
- Result on the example
- one result per row in
B2, filled down toB6 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in B2, filled down to B6. Change any input and the result updates, or edit the formula to experiment.
How it works
An ISO 8601 timestamp is text: the date in the first 10 characters, a T, then the time. DATEVALUE(LEFT(A2,10)) gives the date, TIMEVALUE(MID(A2,12,8)) gives the time as a fraction of a day, and adding them gives one date-time value. The trailing Z means UTC.
=DATEVALUE(LEFT(A2,10))+TIMEVALUE(MID(A2,12,8))Result46086.60417
A2"2026-03-05T14:30:00Z"The value in A2.
LEFT(A2,10)"2026-03-05"LEFT: Characters from the start of text.- text
A2"2026-03-05T14:30:00Z" - num_chars
10
- text
DATEVALUE(LEFT(A2,10))3/5/2026 (46086)DATEVALUE: Converts date text to a date.- date_text
LEFT(A2,10)"2026-03-05"
- date_text
MID(A2,12,8)"14:30:00"MID: Characters from the middle of text.- text
A2"2026-03-05T14:30:00Z" - start_num
12 - num_chars
8
- text
TIMEVALUE(MID(A2,12,8))0.6041666667TIMEVALUE: Converts time text such as "1:30 PM" into a time.- time_text
MID(A2,12,8)"14:30:00"
- time_text
DATEVALUE(LEFT(A2,10))+TIMEVALUE(MID(A2,12,8))46086.60417The + operator adds.
In Google Sheets
The same formula works in Google Sheets: =DATEVALUE(LEFT(A2,10))+TIMEVALUE(MID(A2,12,8)). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =--SUBSTITUTE(LEFT(A2,19),"T"," ") | 3/5/2026 14:30:00, 3/5/2026 9:05:12, 11/1/2026 0:00:00… | Replaces the T with a space and converts the text in one step. |
| =DATEVALUE(LEFT(A2,10)) | 3/5/2026 0:00:00, 3/5/2026 0:00:00, 11/1/2026 0:00:00…Different result | The date only. Drops the time. |
Common mistakes
- A timestamp with an offset like +02:00 is local time. Subtract the offset (add it for a minus sign) to get UTC.
- Fractional seconds like 14:30:00.123Z make the text longer;
MID(A2,12,8)ignores them.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Convert an ISO 8601 timestamp to a date and time
B2, convert the ISO 8601 text timestamp to a real date and time, and fill down to B6.Questions
How do I convert it to my time zone?
Add or subtract hours/24: =B2-5/24 for US Eastern Standard Time.
How do I write a date as ISO 8601 text?
=TEXT(B2,"yyyy-mm-dd")&"T"&TEXT(B2,"hh:mm:ss")&"Z".
Why do I see a number like 46086.60417?
That is the date-time value. Format the cell as a date and time, for example m/d/yyyy h:mm.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.