Functions | |
uint64_t | rdm_timeMeasureMilliSecs (void) |
Time in milli seconds suitable for measuring elapsed time. More... | |
RDM_RETCODE | rdm_timeFromString (const char *str, RDM_PACKED_TIME_T *ptm) |
Convert a string to local time. More... | |
uint16_t | rdm_timeHour (RDM_PACKED_TIME_T tm) |
Get the hour of the day. More... | |
uint16_t | rdm_timeMinute (RDM_PACKED_TIME_T tm) |
Get the minute of the hour. More... | |
uint16_t | rdm_timeSecond (RDM_PACKED_TIME_T tm) |
Get the second of the minute. More... | |
uint16_t | rdm_timeFraction (RDM_PACKED_TIME_T tm) |
Get the fractions of the second. More... | |
RDM_RETCODE | rdm_timeToString (RDM_PACKED_TIME_T timeVal, RDM_TIME_FORMAT time_fmt, char *buf, size_t bufSize, size_t *puSize) |
Convert a time to a string. More... | |
RDM_PACKED_TIME_T | rdm_timeZero (void) |
Get the local time at the start of a day. More... | |
RDM_RETCODE | rdm_timeNow (int16_t time_zone, RDM_PACKED_TIME_T *ptm) |
Get the current local time. More... | |
RDM_RETCODE | rdm_timeNowAsString (int16_t time_zone, char *timebuf, size_t buflen) |
Get current local time as a string. More... | |
RDM_RETCODE | rdm_timetzNowAsString (int16_t time_zone, char *timebuf, size_t buflen) |
Get current time with timezone as a string. More... | |
RDM_RETCODE | rdm_timetzFromString (const char *str, RDM_PACKED_TIMETZ_T *ptz) |
Convert a string to a time. More... | |
RDM_RETCODE | rdm_timetzNow (int16_t time_zone, RDM_PACKED_TIMETZ_T *ptz) |
Get the current time with timezone. More... | |
RDM_RETCODE | rdm_timetzToTime (RDM_PACKED_TIMETZ_T timetzVal, int16_t tz_disp, RDM_PACKED_TIME_T *pTimeVal) |
Convert a time with timezone to local time. More... | |
RDM_RETCODE | rdm_timetzToString (RDM_PACKED_TIMETZ_T timetzVal, RDM_TIME_FORMAT time_fmt, char *buf, size_t bufSize, size_t *puSize) |
Convert a time with timezone to a string. More... | |
RDM_PACKED_TIMETZ_T | rdm_timetzZero (void) |
Get the time at the start of a day. More... | |
The RDM time datatype API. The functions here are located in RDM Base Functionality. Linker option:
-lrdmbase
uint16_t rdm_timeFraction | ( | RDM_PACKED_TIME_T | tm | ) |
#include <rdmtimeapi.h>
Get the fractions of the second.
Get the fractions of the second in 1/10,000th of a second from a packed local time
The fractions of the second (0 - 9999)
[in] | tm | RDM packed local time value |
RDM_RETCODE rdm_timeFromString | ( | const char * | str, |
RDM_PACKED_TIME_T * | ptm | ||
) |
#include <rdmtimeapi.h>
Convert a string to local time.
Convert a string to a packed local time.
sOKAY | Normal, successful return. |
eINVLITERAL | Invalid literal constant specification. |
eRANGE | Numeric value out of range. |
[in] | str | The string to be converted |
[out] | ptm | The packed local time value. The buffer need to be allocated by the caller. |
uint16_t rdm_timeHour | ( | RDM_PACKED_TIME_T | tm | ) |
#include <rdmtimeapi.h>
Get the hour of the day.
Get the hour from a packed local time.
[in] | tm | RDM packed local time value |
uint64_t rdm_timeMeasureMilliSecs | ( | void | ) |
#include <rdmtimeapi.h>
Time in milli seconds suitable for measuring elapsed time.
This function is returning elapsed time with some unspecified base suitable for measuring elapsed time. It is not suitable for generating timestamps or retrieving the actual clock time.
uint16_t rdm_timeMinute | ( | RDM_PACKED_TIME_T | tm | ) |
#include <rdmtimeapi.h>
Get the minute of the hour.
Get the minute of the hour from a packed local time.
[in] | tm | RDM packed local time value |
RDM_RETCODE rdm_timeNow | ( | int16_t | time_zone, |
RDM_PACKED_TIME_T * | ptm | ||
) |
#include <rdmtimeapi.h>
Get the current local time.
Get the current local time for the timezone passed in.
sOKAY | Normal, successful return. |
eBASE_INVTIMEZONE | Invalid time zone value. |
[in] | time_zone | timezone value (in min) |
[out] | ptm | current time adjusted with time_zone. The buffer need to be allocated by the caller. |
RDM_RETCODE rdm_timeNowAsString | ( | int16_t | time_zone, |
char * | timebuf, | ||
size_t | buflen | ||
) |
#include <rdmtimeapi.h>
Get current local time as a string.
Get the current local time in string format.
sOKAY | Normal, successful return. |
eBASE_INVTIMEZONE | Invalid time zone value. |
sTRUNCATE | Result is truncated. |
[in] | time_zone | timezone value (in min) |
[out] | timebuf | NOW value as string |
[in] | buflen | Size of timebuf in number of ASCII characters it can hold |
uint16_t rdm_timeSecond | ( | RDM_PACKED_TIME_T | tm | ) |
#include <rdmtimeapi.h>
Get the second of the minute.
Get the second of the minute from a packed local time.
[in] | tm | RDM packed local time value |
RDM_RETCODE rdm_timeToString | ( | RDM_PACKED_TIME_T | timeVal, |
RDM_TIME_FORMAT | time_fmt, | ||
char * | buf, | ||
size_t | bufSize, | ||
size_t * | puSize | ||
) |
#include <rdmtimeapi.h>
Convert a time to a string.
Convert a packed local time to a string.
sOKAY | Normal, successful return. |
eINVLITERAL | Invalid literal constant specification. |
sTRUNCATE | Result is truncated. |
RDM_RETCODE rdm_timetzFromString | ( | const char * | str, |
RDM_PACKED_TIMETZ_T * | ptz | ||
) |
#include <rdmtimetzapi.h>
Convert a string to a time.
Convert a string to a packed time with timezone.
sOKAY | Normal, successful return. |
eINVLITERAL | Invalid literal constant specification. |
eRANGE | Numeric value out of range. |
[in] | str | The string to be converted |
[out] | ptz | The packed time with timezone. The buffer need to be allocated by the caller. |
RDM_RETCODE rdm_timetzNow | ( | int16_t | time_zone, |
RDM_PACKED_TIMETZ_T * | ptz | ||
) |
#include <rdmtimetzapi.h>
Get the current time with timezone.
Get the current time with timezone.
sOKAY | Normal, successful return. |
eBASE_INVTIMEZONE | Invalid time zone value. |
[in] | time_zone | Timezone value |
[out] | ptz | The current time with timezone |
RDM_RETCODE rdm_timetzNowAsString | ( | int16_t | time_zone, |
char * | timebuf, | ||
size_t | buflen | ||
) |
#include <rdmtimetzapi.h>
Get current time with timezone as a string.
Get the current time with timezone as a string.
sOKAY | Normal, successful return. |
eBASE_INVTIMEZONE | Invalid time zone value. |
sTRUNCATE | Result is truncated. |
[in] | time_zone | Timezone value (in min) |
[out] | timebuf | The current time with timezone |
[in] | buflen | Size of timebuf in number of ASCII characters it can hold |
RDM_RETCODE rdm_timetzToString | ( | RDM_PACKED_TIMETZ_T | timetzVal, |
RDM_TIME_FORMAT | time_fmt, | ||
char * | buf, | ||
size_t | bufSize, | ||
size_t * | puSize | ||
) |
#include <rdmtimetzapi.h>
Convert a time with timezone to a string.
Convert a packed time with timezone to a string.
sOKAY | Normal, successful return. |
eINVLITERAL | Invalid literal constant specification. |
sTRUNCATE | Result is truncated. |
[in] | timetzVal | time with timezone value |
[in] | time_fmt | RDM time format |
[out] | buf | result time string |
[in] | bufSize | buffer size in number of ASCII characters it can hold |
[out] | puSize | resulting size in number of characters |
RDM_RETCODE rdm_timetzToTime | ( | RDM_PACKED_TIMETZ_T | timetzVal, |
int16_t | tz_disp, | ||
RDM_PACKED_TIME_T * | pTimeVal | ||
) |
#include <rdmtimetzapi.h>
Convert a time with timezone to local time.
Convert a packed time with timezone to packed local time.
sOKAY | Normal, successful return. |
[in] | timetzVal | time with timezone value |
[in] | tz_disp | The local timezone |
[out] | pTimeVal | resulting local time value |
RDM_PACKED_TIMETZ_T rdm_timetzZero | ( | void | ) |
#include <rdmtimetzapi.h>
Get the time at the start of a day.
Get the packed time at the start of the day (midnight).
RDM_PACKED_TIME_T rdm_timeZero | ( | void | ) |
#include <rdmtimeapi.h>
Get the local time at the start of a day.
Get the packed local time at the start of the day (midnight).