1

I'm working with some data where I don't know how the time string was generated but an example of what the date string looks like is this 20210713T015433.354Z

I've looked at some examples of date strings (ex1 and ex2) but haven't had any luck decoding it.

I know that the first half of the string is YYYYMMDD, and then I think that T means times but then I don't know what 015433.354Z is.

My eventual goal is to make this into a Date objects in JS but I can't deduce the formatting. beyond the day it occured.

financial_physician
  • 1,672
  • 1
  • 14
  • 34

1 Answers1

1

The date format provided is ISO 8601. Maybe you want to try the following to get a Date object:

new Date(Date.UTC(2021, 7, 13, 1, 54, 33, 354))

As pointed in this SO answer.

Kfcaio
  • 442
  • 1
  • 8
  • 20