Access the user’s local time and time zone in your functions
localtime
namespace from the SDK:
localtime
namespace are below.
All time zones use the IANA time zone database format. For example,
"America/New_York"
. You can find a list of valid time zones
here.
X-Time-Zone
header is present in the request, the time zone is set to
the value of the header.TZ
environment variable is set on the host, the time zone is set to
the value of the variable.modus dev
, Modus uses the host’s local time zone by
default. You can override this by setting the TZ
environment variable in your
.env.local
file."X-Time-Zone"
request header when calling Modus, to use
it for all local time calculations."America/New_York"
."2025-12-31T12:34:56.789-04:00"
.
"2025-12-31T12:34:56.789-04:00"
.
"America/New_York"
.