On this page
  1. time.tzset
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

time.tzset

Prev: time.time_ns | Up: time
Rel: time.asctime, time.clock_getres, time.clock_gettime, time.clock_gettime_ns
Ref: docs.python.org — time.tzset
Tags: #public #python3 #stdlib #time


Import

import time
from time import tzset

Signature & Overview

time.tzset()

Initialize, or reinitialize, the local timezone to the value stored in os.environ['TZ']. The TZ environment variable should be specified in standard Unix timezone format as documented in the tzset man page

Usage

import time

# Unix-only: reloads timezone rules after modifying os.environ["TZ"]
assert hasattr(time, "tzset") or True

Gotchas

REPL Inspect

from time import tzset
help(tzset)

Linked from

Related notes