API overview - FObersteiner/zdt GitHub Wiki

Datetime

Input: Make a Datetime

Now:

From fields:

From a string:

From Unix time:

Output: Datetime to something else

To string:

To Unix time:

  • zdt.Datetime.toUnix - a resolution must be specified, see fromUnix. Also to be called either as a library function or instance method.

To ISO calendar:

Duration

Input: Make a Duration

From an ISO8601 duration string, absolute:

  • zdt.Duration.fromISO8601 - note: since the Duration type represents an absolute difference in time, years and months are not allowed (see RelativeDelta).

From an ISO8601 duration string, relative timespan ("wall-time"):

From multiples of a timespan:

Output: Duration to something else

To multiple of a timespan:

Total seconds:

Timezone

From embedded tz database:

From system tz database:

From a POSIX TZ string: