Created
April 6, 2024 00:46
-
-
Save arshaw/1ef4bf945d68654b86cef2dd8471c48f to your computer and use it in GitHub Desktop.
Ways to avoid BigInt while using Temporal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Temporal.ZonedDateTime(nano, timeZone, calendar) | |
/* instead: */ Temporal.Instant.fromEpochMilliseconds(milli) | |
/* */ .toZonedDateTimeISO(timeZone) | |
/* OR */ | |
/* instead: */ Temporal.Instant.fromEpochMilliseconds(milli) | |
/* */ .toZonedDateTime({ timeZone, calendar }) | |
zonedDateTime.epochMicroseconds | |
/* instead: */ zonedDateTime.epochMilliseconds | |
zonedDateTime.epochNanoseconds | |
/* instead: */ zonedDateTime.epochMilliseconds | |
new Temporal.Instant(nano) | |
/* instead: */ Temporal.Instant.fromEpochMilliseconds(milli) | |
Temporal.Instant.fromEpochMicroseconds(micro) | |
/* instead: */ Temporal.Instant.fromEpochMilliseconds(milli) | |
Temporal.Instant.fromEpochNanoseconds(nano) | |
/* instead: */ Temporal.Instant.fromEpochMilliseconds(milli) | |
instant.epochMicroseconds | |
/* instead: */ instant.epochMilliseconds | |
instant.epochNanoseconds | |
/* instead: */ instant.epochMilliseconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment