Skip to main content

Module clock

Module clock 

Source
Expand description

The job’s start time: \time, \day, \month, \year, the log banner and the PDF creation date.

LuaTeX takes the time once, at startup: from SOURCE_DATE_EPOCH when it is set (with or without FORCE_SOURCE_DATE), otherwise from the clock. It converts it to local time, or to UTC with the -utc option. Dates in PDF format carry the UTC offset (D:19700101010000+01'00' for epoch 0 in Central Europe, D:19700101000000Z with TZ=UTC or -utc).

The local offset is found the way the C library finds it: from $TZ (a zone name, optionally prefixed with :, or a POSIX TZ string), else from /etc/localtime, reading the binary TZif files (RFC 8536) and their POSIX TZ footer rules (POSIX.1, TZ variable) for times after the last transition. Anything unreadable falls back to UTC.

Structs§

Civil
A broken-down date and time.
StartTime
An instant together with the UTC offset in effect there.

Functions§

civil_from_days
The proleptic Gregorian date (year, month, day) of a day number.
days_from_civil
Days since 1970-01-01 of a proleptic Gregorian date.
local_offset
Returns the local UTC offset (seconds east of UTC) at Unix time t.
now
The current time in seconds since the epoch.
offset_for_tz
The offset at t for a TZ value.
parse_source_date_epoch
Interprets a SOURCE_DATE_EPOCH value; None means “use the clock”.
source_date_epoch
SOURCE_DATE_EPOCH from the environment, interpreted like LuaTeX does (see parse_source_date_epoch).
startup_random_seed
The random seed of a job that does not set one.
tzif_offset
The UTC offset at t according to a TZif file.