session.time to work with dates and times in the user’s timezone. It handles timezone detection, date formatting, and conversions so you never have to think about UTC offsets yourself.
Quick Example
API Reference
time.zone
The user’s current IANA timezone string.time.now()
Returns the currentDate.
time.toLocal(date?)
Convert a UTCDate to local wall-clock time in the user’s timezone. If no date is provided, converts the current time.
time.format(date, opts?)
Format a date for display in the user’s timezone. The optionalopts parameter accepts standard Intl.DateTimeFormatOptions.
Intl.DateTimeFormat with the user’s timezone, so all standard options are supported.
time.setTimezone(tz)
Override the timezone at runtime. Throws aRangeError if the timezone string is invalid.

