This module provides various time-related functions in Python like getting the current time or date. Not all functions are available on all platforms and some call underlying C library functions that can have varying semantics between platforms. It explains terminology like epochs, which is the point where time is measured from (January 1, 1970 for Unix), and seconds since the epoch, which excludes leap seconds.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
19 views1 page
Datetime Calendar: Time - Gmtime
This module provides various time-related functions in Python like getting the current time or date. Not all functions are available on all platforms and some call underlying C library functions that can have varying semantics between platforms. It explains terminology like epochs, which is the point where time is measured from (January 1, 1970 for Unix), and seconds since the epoch, which excludes leap seconds.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 1
his module provides various time-related functions.
For related functionality, see also
the datetime and calendar modules. Although this module is always available, not all functions are available on all platforms. Most of the functions defined in this module call platform C library functions with the same name. It may sometimes be helpful to consult the platform documentation, because the semantics of these functions varies among platforms. An explanation of some terminology and conventions is in order. •The epoch is the point where the time starts, and is platform dependent. For Unix, the epoch is January 1, 1970, 00:00:00 (UTC). To find out what the epoch is on a given platform, look at time.gmtime(0). •The term seconds since the epoch refers to the total number of elapsed seconds since the epoch, typically excluding leap seconds. Leap seconds are excluded from this total on all POSIX-compliant platforms. •The functions in this module may not handle dates and times before the epoch or far in the future. The cut-off point in the future is determined by the C library; for 32-bit systems, it is typically in 2038. •Function strptime() can parse 2-digit years when given %y format code. When 2-digit years are parsed, they are converted according to the POSIX and ISO C standards: values 69–99 are mapped to 1969–1999, and values 0–68 are mapped to 2000–2068.