@@ -17,18 +17,23 @@ semantics of these functions varies among platforms.
17
17
18
18
An explanation of some terminology and conventions is in order.
19
19
20
+ .. _epoch :
21
+
20
22
.. index :: single: epoch
21
23
22
24
* The :dfn: `epoch ` is the point where the time starts, and is platform
23
25
dependent. For Unix, the epoch is January 1, 1970, 00:00:00 (UTC).
24
- To find out what the epoch is on a given platform, look at ``gmtime(0) ``.
26
+ To find out what the epoch is on a given platform, look at
27
+ ``time.gmtime(0) ``.
28
+
29
+ .. _leap seconds : https://en.wikipedia.org/wiki/Leap_second
25
30
26
31
.. index :: seconds since the epoch
27
32
28
33
* The term :dfn: `seconds since the epoch ` refers to the total number
29
34
of elapsed seconds since the epoch, typically excluding
30
- `leap seconds < https://en.wikipedia.org/wiki/Leap_second > `_.
31
- Leap seconds are excluded from this total on all POSIX-compliant platforms.
35
+ `leap seconds `_. Leap seconds are excluded from this total on all
36
+ POSIX-compliant platforms.
32
37
33
38
.. index :: single: Year 2038
34
39
@@ -579,27 +584,28 @@ The module defines the following functions and data items:
579
584
580
585
.. function :: time()
581
586
582
- Return the time in seconds since the epoch as a floating point
587
+ Return the time in seconds since the epoch _ as a floating point
583
588
number. The specific date of the epoch and the handling of
584
- `leap seconds <https://en.wikipedia.org/wiki/Leap_second >`_
585
- is platform dependent.
589
+ `leap seconds `_ is platform dependent.
586
590
On Windows and most Unix systems, the epoch is January 1, 1970,
587
591
00:00:00 (UTC) and leap seconds are not counted towards the time
588
592
in seconds since the epoch. This is commonly referred to as
589
593
`Unix time <https://en.wikipedia.org/wiki/Unix_time >`_.
594
+ To find out what the epoch is on a given platform, look at
595
+ ``time.gmtime(0) ``.
590
596
591
597
Note that even though the time is always returned as a floating point
592
598
number, not all systems provide time with a better precision than 1 second.
593
599
While this function normally returns non-decreasing values, it can return a
594
600
lower value than a previous call if the system clock has been set back
595
601
between the two calls.
596
602
597
- The number returned by :func: `time ` may be converted into a more common
603
+ The number returned by :func: `time.time ` may be converted into a more common
598
604
time format (i.e. year, month, day, hour, etc...) in UTC by passing it to
599
- :func: `gmtime ` function or in local time by passing it to the
600
- :func: `localtime ` function. In both cases a :class: ` struct_time ` object
601
- is returned, from which the components of the calendar date may be accessed
602
- as attributes.
605
+ :func: `time. gmtime ` function or in local time by passing it to the
606
+ :func: `time. localtime ` function. In both cases a
607
+ :class: ` time.struct_time ` object is returned, from which the components
608
+ of the calendar date may be accessed as attributes.
603
609
604
610
.. data :: timezone
605
611
0 commit comments