mirror of
https://github.com/micropython/micropython.git
synced 2025-08-23 19:10:30 +02:00
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>
This commit is contained in:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user