summaryrefslogtreecommitdiffstats
path: root/Doc/library/time.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-02-27 16:59:03 (GMT)
committerGeorg Brandl <georg@python.org>2009-02-27 16:59:03 (GMT)
commit5c189b16a8e915889b26d0fecc45faec935092c4 (patch)
tree3f50d55e58a48af4db772dff79fd968800973677 /Doc/library/time.rst
parentfbb995f6c2fe6eda6e41b5525baedb3a48a2ed3b (diff)
downloadcpython-5c189b16a8e915889b26d0fecc45faec935092c4.zip
cpython-5c189b16a8e915889b26d0fecc45faec935092c4.tar.gz
cpython-5c189b16a8e915889b26d0fecc45faec935092c4.tar.bz2
#5365: add quick look conversion table for different time representations.
Diffstat (limited to 'Doc/library/time.rst')
-rw-r--r--Doc/library/time.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/library/time.rst b/Doc/library/time.rst
index c9b7355..1ffef2b 100644
--- a/Doc/library/time.rst
+++ b/Doc/library/time.rst
@@ -118,6 +118,24 @@ An explanation of some terminology and conventions is in order.
The time value sequence was changed from a tuple to a :class:`struct_time`, with
the addition of attribute names for the fields.
+* Use the following functions to convert between time representations:
+
+ +-------------------------+-------------------------+-------------------------+
+ | From | To | Use |
+ +=========================+=========================+=========================+
+ | seconds since the epoch | :class:`struct_time` in | :func:`gmtime` |
+ | | UTC | |
+ +-------------------------+-------------------------+-------------------------+
+ | seconds since the epoch | :class:`struct_time` in | :func:`localtime` |
+ | | local time | |
+ +-------------------------+-------------------------+-------------------------+
+ | :class:`struct_time` in | seconds since the epoch | :func:`calendar.timegm` |
+ | UTC | | |
+ +-------------------------+-------------------------+-------------------------+
+ | :class:`struct_time` in | seconds since the epoch | :func:`mktime` |
+ | local time | | |
+ +-------------------------+-------------------------+-------------------------+
+
The module defines the following functions and data items: