This module provides minimal time and date functions. For a
newer and more complete module, see the
Epoch time is the time in seconds since some arbitrary starting point. For example, Unix measures time in seconds since January 1, 1970.
UTC is Coordinated Universal Time, the time on the zero meridian (which goes through London).
DST refers to Daylight Savings Time.
A time tuple is a 9-tuple
with these elements,
||Second, in [0,59].|
||Month, 1 for January, 12 for December.||
||Day of week, 0 for Monday, 6 for Sunday.|
||Day of month, in [1,31].||
||Ordinal day of the year, in [1,366].|
||Hour, in [0,23].||
DST flag: |
||Minute, in [0,59].|
Contents of the
The local DST offset, in seconds west of UTC (negative for east of UTC).
For a time-tuple
, returns a string of exactly 24 characters
with this format:
"Thu Jun 12 15:25:31 1997"
The default time is now.
The accumulated CPU time of the current process in seconds, as a float.
Converts an epoch time
to a string with the same
asctime(). The default time is
Nonzero if there is a DST value defined locally.
Returns the time-tuple corresponding to UTC at epoch
DST flag will be zero. The default time is now.
Returns the time-tuple corresponding to local time at
. The default time is now.
Converts a time-tuple
to epoch time as a float,
the local time.
Suspend execution of the current process for
can be a
float or integer.
Time formatting function; formats a time-tuple
according to format string
. The default time
is now. As
with the old string
format operator, format codes start with
%, and other text appears unchanged
in the result. See the table of codes
The current epoch time, as a float.
The local non-DST time zone as an offset in seconds west of UTC (negative for east of UTC). This value applies when daylight savings time is not in effect.
A 2-tuple (
name of the non-DST time zone locally and
is the name of
the local DST time zone. For example, in Socorro, NM,
Format codes for the
Abbreviated weekday name, e.g., |
Full weekday name, e.g., |
Abbreviated month name, e.g., |
Full month name, e.g., |
Day of the month, two digits with left zero fill; e.g.
|Hour on the 24-hour clock, two digits with zero fill.|
|Hour on the 12-hour clock, two digits with zero fill.|
|Day of the year as a decimal number, three digits with zero fill, e.g. '366'.|
|Decimal month, two digits with zero fill.|
|Minute, two digits with zero fill.|
|Second, two digits with zero fill.|
|Numeric weekday: 0 for Sunday, 6 for Saturday.|
|Two-digit year. Not recommended!|
If there is a time zone, a string representing that
zone; e.g., |
Outputs the character |