diff options
author | robert-hh <robert@hammelrath.com> | 2024-12-29 21:32:44 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-05-28 12:13:28 +1000 |
commit | 2f864416c6535cdf33a85ea0092e2415dc29dde3 (patch) | |
tree | 58310c470784fc1fb57fcf85c961b1ef0f547d5c /docs/library | |
parent | bbdc832ca9719947124ebcd70da8d08b38cae24b (diff) |
docs/library/time: Amend the documentation of time.mktime().
By showing the argument and refer to epoch instead of a fixed date. The
note about epoch lists the ports using the POSIX epoch.
Signed-off-by: robert-hh <robert@hammelrath.com>
Diffstat (limited to 'docs/library')
-rw-r--r-- | docs/library/time.rst | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/library/time.rst b/docs/library/time.rst index 8c1c1d4d6..b53bb133e 100644 --- a/docs/library/time.rst +++ b/docs/library/time.rst @@ -9,9 +9,10 @@ The ``time`` module provides functions for getting the current time and date, measuring time intervals, and for delays. -**Time Epoch**: Unix port uses standard for POSIX systems epoch of -1970-01-01 00:00:00 UTC. However, some embedded ports use epoch of -2000-01-01 00:00:00 UTC. Epoch year may be determined with ``gmtime(0)[0]``. +**Time Epoch**: The unix, windows, webassembly, alif, mimxrt and rp2 ports +use the standard for POSIX systems epoch of 1970-01-01 00:00:00 UTC. +The other embedded ports use an epoch of 2000-01-01 00:00:00 UTC. +Epoch year may be determined with ``gmtime(0)[0]``. **Maintaining actual calendar date/time**: This requires a Real Time Clock (RTC). On systems with underlying OS (including some @@ -57,11 +58,11 @@ Functions * weekday is 0-6 for Mon-Sun * yearday is 1-366 -.. function:: mktime() +.. function:: mktime(date_time_tuple) This is inverse function of localtime. It's argument is a full 8-tuple which expresses a time as per localtime. It returns an integer which is - the number of seconds since Jan 1, 2000. + the number of seconds since the time epoch. .. function:: sleep(seconds) |