]> granicus.if.org Git - python/commitdiff
#5365: add quick look conversion table for different time representations.
authorGeorg Brandl <georg@python.org>
Fri, 27 Feb 2009 16:59:03 +0000 (16:59 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 27 Feb 2009 16:59:03 +0000 (16:59 +0000)
Doc/library/time.rst

index c9b7355316026a9dca00a9383df66a9dea9878be..1ffef2b24494b3572ae4334b65242c51de1f6b36 100644 (file)
@@ -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: