Skip to content

Instantly share code, notes, and snippets.

@Msirkovsky
Last active October 23, 2022 05:31
const instant = Temporal.Instant.from('2022-01-01T00:00+00:00')
console.log(instant.hour) // returns undefined!
const zdtTokyo = instant.toZonedDateTimeISO('Asia/Tokyo')
console.log(zdtTokyo.hour) //returns 9
const zdtPrague = instant.toZonedDateTimeISO('Europe/Prague')
console.log(zdtPrague.hour) //returns 1
const zdtNewYork = instant.toZonedDateTimeISO('America/New_York')
console.log(zdtNewYork.hour) //returns 19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment