toEpochMilli
toEpochMilli: (Instant) -> numberMilliseconds since the epoch; ArithmeticException past a long.
Instant.now()
Instant.ofEpochMilli(…)
Instant.ofEpochSecond(…)| Method | Returns | Description |
|---|---|---|
toEpochMilli() | number | Milliseconds since the epoch; ArithmeticException past a long. |
getEpochSecond() | number | Whole seconds since the epoch (floored). |
getNano() | number | The nano-of-second, 0 to 999,999,999. |
plus(Duration) | Instant | (Instant, Duration) -> Instant: This instant plus a Duration. |
plus(number, ChronoUnit | RSTimeUnit) | Instant | |
minus(Duration) | Instant | (Instant, Duration) -> Instant: This instant less a Duration. |
minus(number, ChronoUnit | RSTimeUnit) | Instant | |
plusMillis(number) | Instant | Plus millisToAdd ms. |
plusSeconds(number) | Instant | Plus secondsToAdd s. |
plusNanos(number) | Instant | Plus nanosToAdd ns. |
minusMillis(number) | Instant | Less millisToSubtract ms. |
minusSeconds(number) | Instant | Less secondsToSubtract s. |
minusNanos(number) | Instant | Less nanosToSubtract ns. |
isAfter(Instant) | boolean | Whether this is after otherInstant. |
isBefore(Instant) | boolean | Whether this is before otherInstant. |
compareTo(Instant) | number | The seconds compared, then the nanos subtracted (which can answer other than -1, 0 and 1). |
until_(Instant | LocalTime | LocalDate | LocalDateTime | ZonedDateTime, ChronoUnit | RSTimeUnit) | number | The amount of unit until endExclusive (an Instant or ZonedDateTime), truncated. |
truncatedTo(ChronoUnit | RSTimeUnit) | Instant | This instant truncated to unit (which must divide a day). |
atZone(ZoneId) | ZonedDateTime | This instant in zone. |
equals(any) | boolean | Whether other is an equal Instant. |
hashCode() | number | The value's hash. |
toString() | string | ISO-8601 in UTC, 2025-09-21T14:13:20.007Z. |
now() | Instant | The wall clock now. |
ofEpochMilli(number) | Instant | The instant epochMilli ms after 1970-01-01T00:00Z. |
ofEpochSecond(number) | Instant | (number) -> Instant: The instant epochSecond s after 1970-01-01T00:00Z. |
ofEpochSecond(number, number) | Instant | |
parse(string) | Instant | DateTimeFormatter.ISO_INSTANT's text (2007-12-03T10:15:30.00Z, or an offset). |
| Method | Returns | Description |
|---|---|---|
ChronoZonedDateTime.toInstant | Instant | The instant. |
Date.toInstant | Instant | Date#toInstant(). |
DiscordPresence.getEndTimestamp | Instant? | When the activity ends. |
DiscordPresence.getStartTimestamp | Instant? | When the activity started. |
InstantClass.now | Instant | The wall clock now. |
InstantClass.ofEpochMilli | Instant | The instant epochMilli ms after 1970-01-01T00:00Z. |
InstantClass.ofEpochSecond | Instant | (number) -> Instant: The instant epochSecond s after 1970-01-01T00:00Z. |
InstantClass.parse | Instant | DateTimeFormatter.ISO_INSTANT's text (2007-12-03T10:15:30.00Z, or an offset). |
LoopTimer.getStartTime | Instant | When it was made. |
Timer.getEndTime | Instant | When it runs out. |
Timer.getStartTime | Instant | When it was made. |
toEpochMillitoEpochMilli: (Instant) -> numberMilliseconds since the epoch; ArithmeticException past a long.
getEpochSecondgetEpochSecond: (Instant) -> numberWhole seconds since the epoch (floored).
getNanogetNano: (Instant) -> numberThe nano-of-second, 0 to 999,999,999.
plusplus: ((Instant, Duration) -> Instant) & ((Instant, number, ChronoUnit | RSTimeUnit) -> Instant)(Instant, Duration) -> Instant: This instant plus a Duration.
(Instant, number, ChronoUnit | RSTimeUnit) -> Instant: This instant plus amountToAdd of unit (NANOS to DAYS; a longer unit is unsupported, and an RSTimeUnit overflows the stack).
minusminus: ((Instant, Duration) -> Instant) & ((Instant, number, ChronoUnit | RSTimeUnit) -> Instant)(Instant, Duration) -> Instant: This instant less a Duration.
(Instant, number, ChronoUnit | RSTimeUnit) -> Instant: This instant less amountToSubtract of unit.
plusMillisplusMillis: (Instant, number) -> InstantPlus millisToAdd ms.
plusSecondsplusSeconds: (Instant, number) -> InstantPlus secondsToAdd s.
plusNanosplusNanos: (Instant, number) -> InstantPlus nanosToAdd ns.
minusMillisminusMillis: (Instant, number) -> InstantLess millisToSubtract ms.
minusSecondsminusSeconds: (Instant, number) -> InstantLess secondsToSubtract s.
minusNanosminusNanos: (Instant, number) -> InstantLess nanosToSubtract ns.
isAfterisAfter: (Instant, Instant) -> booleanWhether this is after otherInstant.
isBeforeisBefore: (Instant, Instant) -> booleanWhether this is before otherInstant.
compareTocompareTo: (Instant, Instant) -> numberThe seconds compared, then the nanos subtracted (which can answer other than -1, 0 and 1).
until_until_: (Instant, Instant | LocalTime | LocalDate | LocalDateTime | ZonedDateTime, ChronoUnit | RSTimeUnit) -> numberThe amount of unit until endExclusive (an Instant or ZonedDateTime), truncated.
Luau reserves until, so this member is spelled until_; it behaves exactly as until.
truncatedTotruncatedTo: (Instant, ChronoUnit | RSTimeUnit) -> InstantThis instant truncated to unit (which must divide a day).
atZoneatZone: (Instant, ZoneId) -> ZonedDateTimeThis instant in zone.
equalsequals: (Instant, any) -> booleanWhether other is an equal Instant.
hashCodehashCode: (Instant) -> numberThe value's hash.
toStringtoString: (Instant) -> stringISO-8601 in UTC, 2025-09-21T14:13:20.007Z.
nownow: () -> InstantThe wall clock now.
ofEpochMilliofEpochMilli: (number) -> InstantThe instant epochMilli ms after 1970-01-01T00:00Z.
ofEpochSecondofEpochSecond: ((number) -> Instant) & ((number, number) -> Instant)(number) -> Instant: The instant epochSecond s after 1970-01-01T00:00Z.
(number, number) -> Instant: The instant epochSecond s plus nanoAdjustment ns after the epoch.
parseparse: (string) -> InstantDateTimeFormatter.ISO_INSTANT's text (2007-12-03T10:15:30.00Z, or an offset).