-
-
Notifications
You must be signed in to change notification settings - Fork 24
utime
The utime module provides functions for getting the current time and date, measuring time intervals, and for delays.
Time Epoch: This port uses standard for POSIX systems epoch of 1970-01-01 00:00:00 UTC.
Maintaining actual calendar date/time: K210 RTC peripheral is used for maintaining the acctual date/time.
The date/time information is lost after power is removed.
Support for external RTC module is planned for some later time.
## Methods
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.
The time returnes is corrected to the local time zone.
- year includes the century (for example 2014).
- month is 1-12
- mday is 1-31
- hour is 0-23
- minute is 0-59
- second is 0-59
- weekday is 0-6 for Mon-Sun
- yearday is 1-366
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.
The time returned is the UTC+0 time.
- year includes the century (for example 2014).
- month is 1-12
- mday is 1-31
- hour is 0-23
- minute is 0-59
- second is 0-59
- weekday is 0-6 for Mon-Sun
- yearday is 1-366
This is inverse function of gmtime/localtime. It’s argument is a full 8-tuple which expresses a time as per gmtime/localtime. It returns an integer which is the number of seconds since Epoch (Jan 1, 1970).
If the optional argument tz
is provides, the local time zone is set.
The tz
argument must be a time zone string, for example "CET-1CEST,M3.5.0,M10.5.0/3"
.
If the optional argument setrtc
is True
, the system RTC time is set.
Convert a tuple time representing a time as returned by gmtime()
or localtime()
to a string as specified by the format
argument. If time
is not provided, the current RTC time is used.
format
must be a string. Standard Python time formating should be used
If local
argument is True
(default), local time is used, if False
gmtime is used.
Sleep for the given number of seconds.
Seconds provided as integer or a floating-point (sleep for a fractional number of seconds) are accepted.
Sleep for the given number of milli seconds.
Sleep for the given number of micro seconds.
- Maix-M1 schematic
- Maix-Bit schematic
- Maix-Go schematic
- Kendryte K210 datasheet
- RISC-V ISA Design
- RISC-V ISA Manual
- Forum
- MicroPython documentation
If you find this project useful, you can contribute by making a donation