O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

time

The time module provides various time-related functions. In Python, time is measured as the number of seconds since the “epoch.” The epoch is the beginning of time (the point at which time = 0 seconds). The epoch is January 1, 1970 on UNIX and can be determined by calling time.gmtime(0) on other systems.

The following variables are defined:

accept2dyear

A Boolean value that indicates whether two-digit years are accepted. Normally this is True, but it’s set to False if the environment variable $PYTHONY2K is set to a non-empty string. The value can be changed manually as well.

altzone

The time zone used during daylight saving time (DST), if applicable.

daylight

Is set to a nonzero value if a DST time zone has been defined.

timezone

The local ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required