datetimeΒΆ

Datetime (qurry.qurrium.utils.datetime)

class qurry.tools.datetime.DatetimeDict[source]ΒΆ

A dictionary that records the time when a key is added.

add_only(eventname: str) tuple[str, str][source]ΒΆ

Adds a key with the current time no matter the key does not exist.

Parameters:

eventname (str) – The name of the event.

Returns:

The name of the event and the time.

Return type:

tuple[str, str]

add_serial(eventname: str) tuple[str, str][source]ΒΆ

Adds a key with the current time and a serial number if the key exists.

Parameters:

eventname (str) – The name of the event.

Returns:

The name of the event and the time.

Return type:

tuple[str, str]

last_events(number: int = 1) list[tuple[str, str]][source]ΒΆ

Returns the last event and its time.

Parameters:

number (int) – The number of the last event.

Returns:

The last event and its time.

Return type:

list[tuple[str, str]]

loads(datetimes: dict[str, str])[source]ΒΆ

Loads a dictionary of datetimes.

Parameters:

datetimes (dict[str, str]) – A dictionary of datetimes.

qurry.tools.datetime.current_time()[source]ΒΆ

Returns the current time in the format of YYYY-MM-DD HH:MM:SS.