From 2f864416c6535cdf33a85ea0092e2415dc29dde3 Mon Sep 17 00:00:00 2001 From: robert-hh Date: Sun, 29 Dec 2024 21:32:44 +0100 Subject: [PATCH] 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 --- docs/library/time.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/library/time.rst b/docs/library/time.rst index 8c1c1d4d6f..b53bb133ec 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)