0

I have an API that returns a datetime string in this format 2020-02-15T06:51:00.000Z in the Eastern US timezone.

I am trying to convert it to my local timezone and I have tried simply passing it into a new date constructor like this new Date('2020-02-15T06:51:00.000Z') with no success.

How can I convert it to my local timezone?

hcphoon
  • 538
  • 5
  • 24

1 Answers1

0

You could try like:

new Date().toLocaleString("en-US", {timeZone: "America/New_York"})