diff options
author | Damien George <damien@micropython.org> | 2020-09-14 00:07:12 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-09-18 16:25:36 +1000 |
commit | bd7af6151d605d3fc8f70cb9ddf45b2fd7881f08 (patch) | |
tree | 7ef14fe3309c15b6518f656151bc8fafc842be14 /docs/library/utime.rst | |
parent | b28758054b586fe41f56e462856d89f28c5e3f6a (diff) | |
download | micropython-bd7af6151d605d3fc8f70cb9ddf45b2fd7881f08.tar.gz micropython-bd7af6151d605d3fc8f70cb9ddf45b2fd7881f08.zip |
ports: Add utime.gmtime() function.
To portably get the Epoch. This is simply aliased to localtime() on ports
that are not timezone aware.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'docs/library/utime.rst')
-rw-r--r-- | docs/library/utime.rst | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/docs/library/utime.rst b/docs/library/utime.rst index 7fe83f5abe..8c222ede5f 100644 --- a/docs/library/utime.rst +++ b/docs/library/utime.rst @@ -36,11 +36,17 @@ behave not as expected. Functions --------- -.. function:: localtime([secs]) +.. function:: gmtime([secs]) + localtime([secs]) - Convert a time expressed in seconds since the Epoch (see above) into an 8-tuple which - contains: (year, month, mday, hour, minute, second, weekday, yearday) - If secs is not provided or None, then the current time from the RTC is used. + Convert the time *secs* expressed in seconds since the Epoch (see above) into an + 8-tuple which contains: ``(year, month, mday, hour, minute, second, weekday, yearday)`` + If *secs* is not provided or None, then the current time from the RTC is used. + + The `gmtime()` function returns a date-time tuple in UTC, and `localtime()` returns a + date-time tuple in local time. + + The format of the entries in the 8-tuple are: * year includes the century (for example 2014). * month is 1-12 |