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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user