time

Provides timekeeping functions.

Classes

_class struct_time(object)

Time value returned by various functions.

_let x = struct_time(iterable: tuple)

struct_time.__init__(iterable: tuple)

Create a struct_time from a 9-tuple of int values. The format of iterable is (tm_year,tm_mon,tm_mday,tm_hour,tm_min,tm_sec,tm_wday,tm_yday,tm_isdst).

_property struct_time.tm_hour

Clock hour, [0, 23]

_property struct_time.tm_isdst

0, 1, -1 for unknown

_property struct_time.tm_mday

Day of the month, [1, 31]

_property struct_time.tm_min

Clock minute, [0, 59]

_property struct_time.tm_mon

Month, [1, 12]

_property struct_time.tm_sec

Clock seconds, [0, 61] (maybe, due to leap seconds, depends on platform)

_property struct_time.tm_wday

Day of week, [0, 6], 0 is Monday.

_property struct_time.tm_yday

Day of year [1, 366]

_property struct_time.tm_year

Calendar year

Functions

_asctime(t=time.localtime())

Convert time to string.

If t is not provided, the current localtime is used.

_ctime(secs=time.time())

Convert seconds since epoch to string.

If secs is not provided, the current time is used.

_gmtime(secs=time.time())

Convert seconds since epoch to UTC time.

If secs is not provided, the current time is used.

_localtime(seconds=time.time())

Convert seconds since epoch to local time.

If seconds is not provided, the current time is used.

_mktime(t)

Convert from local time to seconds since epoch.

For compatibility with time a float is returned.

_sleep(secs)

Pause execution of the current thread.

Uses the system usleep() function to sleep for secs seconds, which may be a float or int. The available precision is platform-dependent.

_strftime(format,t=time.localtime())

Format time string with system function.

Uses the system strftime C function to convert a struct_time to a string. If t is not provided, the current localtime is used.

_time()

Return the elapsed seconds since the system epoch.

Returns a float representation of the number of seconds since the platform's epoch date. On POSIX platforms, this is the number of seconds since 1 January 1970. The precision of the return value is platform-dependent.