class documentation

class Time:

Constructor: Time(thread_manager)

View In Hierarchy

Handles time-related functions.

Method __del__ Deinitialize the RTC and stop any running time task.
Method __init__ Initialize the time manager.
Method fetch Fetch the current date and time from NTP.
Method set Set the current date and time.
Class Variable __slots__ Undocumented
Property date Return the current date only as string
Property is_fetching Return whether the time is currently being fetched.
Property is_running Return whether the time fetching process is currently running.
Property is_set Return whether the time has been set.
Property rtc Return the RTC object.
Property time Return the current time only as string
Instance Variable _current_task Undocumented
Instance Variable _is_set Undocumented
Instance Variable _lock Undocumented
Instance Variable _requested Undocumented
Instance Variable _rtc Undocumented
Instance Variable _running Undocumented
Instance Variable _thread_manager Undocumented
def __del__(self):

Deinitialize the RTC and stop any running time task.

def __init__(self, thread_manager=None):

Initialize the time manager.

Parameters
thread_manager:object or NoneManager for running the NTP fetch in a thread. Defaults to None.
def fetch(self, offset: int = 0) -> bool:

Fetch the current date and time from NTP.

Originated from: https://github.com/micropython/micropython-lib/blob/master/micropython/net/ntptime/ntptime.py

Parameters
offset:intTimezone offset in hours to apply. Defaults to 0.
Returns
boolTrue if the fetch was started or time was already set, False otherwise.
def set(self, year, month, day, hour, minute, second):

Set the current date and time.

Parameters
year:intYear.
month:intMonth.
day:intDay of the month.
hour:intHour.
minute:intMinute.
second:intSecond.
__slots__: tuple[str, ...] =

Undocumented

@property
date: str =

Return the current date only as string

@property
is_fetching: bool =

Return whether the time is currently being fetched.

@property
is_running: bool =

Return whether the time fetching process is currently running.

@property
is_set: bool =

Return whether the time has been set.

@property
rtc =

Return the RTC object.

@property
time: str =

Return the current time only as string

_current_task =

Undocumented

_is_set: bool =

Undocumented

_lock =

Undocumented

_requested: bool =

Undocumented

_rtc =

Undocumented

_running: bool =

Undocumented

_thread_manager =

Undocumented