long unixTime(string timeString = "")

The function returns number of seconds since 1970-01-01.

Parameters

timeString

String with the format 'YYYY-MM-DD hh:mm:ss' or 'YYYY-MM-DDThh:mm:ss'. If the string is empty, the function returns current time. By default, empty.

string getTimeString(SysTime sysTime)

Gets a time string from the std.datetime.systime.SysTime object.

Returns

String with format "YYYY-MM-DD HH:MM:SS".

string getTimeString()

Gets a time string with the current time.

Returns

String with format "YYYY-MM-DD HH:MM:SS".

string getTimeString(long secondsByUnixTime)

Gets a time string by UNIX time (number of seconds).

Returns

String with format "YYYY-MM-DD HH:MM:SS".

string getTimeString(timestamp_t t)

Gets a time string by timestamp (only seconds from timestamp is used).

Returns

String with format "YYYY-MM-DD HH:MM:SS".

string getTimeExtString(timestamp_t t)

Gets a time string by timestamp content with nanoseconds.

Returns

String with format "YYYY-MM-DD HH:MM:SS.NNNNNNNNN".

string getTimeExtString()

Gets a string containing the current time with nanoseconds.

Returns

String with format "YYYY-MM-DD HH:MM:SS.NNNNNNNNN".

timestamp_t getCurrentTimestamp()

Current time as timestamp_t.

SysTime convTimestampToSysTime(timestamp_t t)

Transforms UNIX timestamp structure to std.datetime.systime.SysTime. SysTime stores hectonanoseconds, so some of the timestamp info is lost.

string getTZOffsetAsString()

Returns string with timezone offset (hours and minutes) like +0300 or -0700.

void sleep(double seconds)

The function makes a delay, expressed in seconds.

void msleep(ulong milliseconds)

The function makes a delay, expressed in milliseconds.

void usleep(ulong microseconds)

The function makes a delay, expressed in microseconds.

Public imports