wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/Time/GetLinuxTime

GetLinuxTime

Reads the OPI board clock into the g_datetime structure.

time_t GetLinuxTime(void);

Parameters

This function does not accept any parameters.

Return Value

This function sets the global g_datetime structure based on the current Linux time. This function also returns a time_t value. time_t is an integer number of seconds since January 1, 1970 midnight. This can be useful to store date/time values in a database using this integer to facilitate indexing and sorting.

Remarks

The IsTimeChanged function copies the current time into the g_datetime structure only when the time is changed so it is more efficient to use IsTimeChanged instead of this function.

Examples

GetLinuxTime();
DisplayText(0, 0, GetTimeStr(1));
time_t now = GetLinuxTime();
// Now is an integer seconds since January 1, 1970 midnight

See Also

Last modified 4 years ago Last modified on 02/01/21 09:38:44
Note: See TracWiki for help on using the wiki.