Let’s say you have this UTC time string: "2023-03-13T03:31:01Z"
You can do it like this:
javascript
const utcDate = new Date("2023-03-13T03:31:01Z"); const localDate = new Date(utcDate.getTime() - utcDate.getTimezoneOffset() * 60000);
Explanation here:
- ok
- one
lorem
ipsum dolor - two
- se