All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Detailed Description

Standard system time functions.

This module contains standard time functions, to get system time, convert to local time or UTC, and format for printing.

Function Documentation

struct tm* gmtime ( const time_t timep)

Converts a provided Unix Timestamp into a Time struct with UTC time. UTC Time is the time at GMT timezone, Coordinated Universal Time.

Parameters
timepis the Unix Timestamp to convert
Returns
pointer to time converted to static Time struct.
struct tm* localtime ( const time_t timep)

Converts a provided Unix Timestamp into a Time struct with local time.

Parameters
timepis the Unix Timestamp to convert
Returns
pointer to time converted to static Time struct.
size_t strftime ( char *  s,
size_t  max,
const char *  format,
const struct tm tm 
)

Prints the time provided with conditional formatting into a provided string. Example: format="Todays Date is %A %B %d, %Y." Results in "Todays Date is Thursday October 31, 2013.".

Parameters
sprovides a preallocated string for storing the date result.
maxis the size of the preallocated string.
formatis a string containing output date text formatting.
tmcontains a Time struct to be formatted for the output string.
Returns
The length of the output string placed into param s.
time_t time ( time_t tloc)

Returns the current time in Unix Timestamp Format.

Parameters
tlocif provided receives current time (NULL recommended)
Returns
Current time in Unix Timestamp Format
uint16_t time_ms ( time_t tloc,
uint16_t out_ms 
)

Returns the current time in Unix Timestamp Format with Milliseconds.

Parameters
tlocif provided receives current Unix Time seconds portion
out_msif provided receives current Unix Time milliseconds portion
Returns
Current Unix Time milliseconds portion

Data Structure Documentation

struct tm

Time struct, with values separated into incremental: year, month, day_in_month, hour, minute, second and informational: Day in week, Day in Year, is it daylight savings time.

Typedef Documentation

typedef int32_t time_t

Seconds since January 1st, 1970 UTC (Unix Timestamp)