Closed n-ae closed 1 month ago
parseISO('2024-10-03T08:58:50', { in: tz('America/New_York') }).toISOString()
Thanks but that returns:
2024-10-03T08:58:50.000-04:00
whereas I want:
2024-10-03T12:58:50.000Z
This is how I done it.
const datetimeString = '2024-10-03T08:58:50';
const timeZone = 'America/New_York'
const timestamp = parseISO(datetimeString, { in: tz(timeZone) })
const formattedTimestamp = formatISO(timestamp, { in: tz('UTC') })
How can I implement below:
with current versions of date-fns libraries? I am trying to get iso formatted utc representation of a local timestamp.