Time
Utilities related to time, including for daily rewards.
Functions
GetUnixTimestampUTC
Time.GetUnixTimestampUTC(unixTimestamp: number?) → numberReturns the current unix timestamp in UTC, or the inputted timestamp if provided.
GetDateTimeUTC
Time.GetDateTimeUTC(unixTimestamp: number?) → DateTimeReturns a DateTime converted to universal time.
GetStartOfDayUTC
Time.GetStartOfDayUTC(unixTimestamp: number?) → numberReturns the unix timestamp for the start of the UTC day.
GetStartOfNextDayUTC
Time.GetStartOfNextDayUTC(unixTimestamp: number?) → numberReturns the unix timestamp for the start of the next UTC day.
GetSecondsUntilNextDayUTC
Time.GetSecondsUntilNextDayUTC(unixTimestamp: number?) → numberReturns the amount of seconds until the next UTC day begins.
IsSameDayUTC
Time.IsSameDayUTC(firstUnixTimestamp: number,secondUnixTimestamp: number) → booleanReturns true if both timestamps occur on the same UTC day.
GetDayDifferenceUTC
Time.GetDayDifferenceUTC(earlierUnixTimestamp: number,laterUnixTimestamp: number) → numberReturns the whole UTC day difference between two timestamps.
FormatSecondsToClockString
Time.FormatSecondsToClockString(totalSeconds: number) → stringConverts a time duration in seconds to a formatted string of xx:xx:xx.
CanClaimDailyReward
Time.CanClaimDailyReward(lastClaimTimestampUTC: number?,currentTimestampUTC: number?) → booleanReturns true if a daily reward can be claimed.
WasDailyRewardStreakMissed
Time.WasDailyRewardStreakMissed(lastClaimTimestampUTC: number?,currentTimestampUTC: number?) → boolean
Returns true if more than one UTC day has passed since the last claim.
This is useful for resetting daily reward streaks.