Functions | |
const char * | rdm_timestampDayAbr (RDM_PACKED_TIMESTAMP_T ts) |
Get the day abbreviation. More... | |
const char * | rdm_timestampDayName (RDM_PACKED_TIMESTAMP_T ts) |
Get the day name. More... | |
uint16_t | rdm_timestampDayOfMonth (RDM_PACKED_TIMESTAMP_T ts) |
Get the day of the month. More... | |
uint16_t | rdm_timestampDayOfWeek (RDM_PACKED_TIMESTAMP_T ts) |
Get the day of the week. More... | |
uint16_t | rdm_timestampDayOfYear (RDM_PACKED_TIMESTAMP_T ts) |
Get the day of the year. More... | |
void | rdm_timestampDaysDiff (RDM_PACKED_TIMESTAMP_T start, RDM_PACKED_TIMESTAMP_T end, uint32_t *diff) |
Get the difference between two timestamps. More... | |
RDM_RETCODE | rdm_timestampFromString (const char *str, RDM_DATE_FORMAT date_fmt, RDM_PACKED_TIMESTAMP_T *ptv) |
Convert from a string to a timestamp. More... | |
uint16_t | rdm_timestampHour (RDM_PACKED_TIMESTAMP_T ts) |
Get the hour of the day. More... | |
uint16_t | rdm_timestampMinute (RDM_PACKED_TIMESTAMP_T ts) |
Get the minute of the hour. More... | |
uint16_t | rdm_timestampSecond (RDM_PACKED_TIMESTAMP_T ts) |
Get the second of the minute. More... | |
uint16_t | rdm_timestampFraction (RDM_PACKED_TIMESTAMP_T ts) |
Get the fractions of the second. More... | |
uint16_t | rdm_timestampMonth (RDM_PACKED_TIMESTAMP_T ts) |
Get the day of the month. More... | |
const char * | rdm_timestampMonthAbr (RDM_PACKED_TIMESTAMP_T ts) |
Get the month abbreviation. More... | |
const char * | rdm_timestampMonthName (RDM_PACKED_TIMESTAMP_T ts) |
Get the month name. More... | |
RDM_RETCODE | rdm_timestampNow (int16_t time_zone, RDM_PACKED_TIMESTAMP_T *ts) |
Get the current local timestamp. More... | |
RDM_RETCODE | rdm_timestampNowAsString (int16_t time_zone, char *tsbuf, size_t buflen) |
Get the current local timestamp as string. More... | |
double | rdm_timestampNowAsDouble (void) |
Get the current timestamp as a double. More... | |
uint16_t | rdm_timestampQuarter (RDM_PACKED_TIMESTAMP_T ts) |
Get the quarter of the year. More... | |
RDM_RETCODE | rdm_timestampToString (RDM_PACKED_TIMESTAMP_T tmsv, RDM_DATE_FORMAT date_fmt, char date_sep, RDM_TIME_FORMAT time_fmt, char *buf, size_t bufSize, size_t *puSize) |
Convert a timestamp to a string. More... | |
uint16_t | rdm_timestampWeek (RDM_PACKED_TIMESTAMP_T ts) |
Get the week of the year. More... | |
int32_t | rdm_timestampYear (RDM_PACKED_TIMESTAMP_T ts) |
Get the year. More... | |
RDM_PACKED_TIMESTAMP_T | rdm_timestampZero (void) |
Get the timestamp of the epoch. More... | |
RDM_RETCODE | rdm_timestamptzFromTimestamp (RDM_PACKED_TIMESTAMP_T tsVal, int16_t tz, RDM_PACKED_TIMESTAMPTZ_T *pTszVal) |
Convert a local timestamp to timestamp with timezone. More... | |
RDM_RETCODE | rdm_timestamptzFromString (const char *str, RDM_DATE_FORMAT date_fmt, RDM_PACKED_TIMESTAMPTZ_T *ptsz) |
Convert from a string to a timestamp with timezone. More... | |
RDM_RETCODE | rdm_timestamptzNow (int16_t time_zone, RDM_PACKED_TIMESTAMPTZ_T *tsz) |
Get the current timestamp with timezone. More... | |
RDM_RETCODE | rdm_timestamptzNowAsString (int16_t time_zone, char *tszbuf, size_t buflen) |
Get the current timestamp with timezone as string. More... | |
RDM_RETCODE | rdm_timestamptzToTimestamp (RDM_PACKED_TIMESTAMPTZ_T tstzVal, int16_t tz_disp, RDM_PACKED_TIMESTAMP_T *pTsVal) |
Convert a timestamp with timezone to a string. More... | |
RDM_RETCODE | rdm_timestamptzToString (RDM_PACKED_TIMESTAMPTZ_T tszVal, RDM_DATE_FORMAT date_format, char date_sep, RDM_TIME_FORMAT time_format, char *buf, size_t bufSize, size_t *puSize) |
Convert a timestamp with timezone to a string. More... | |
RDM_PACKED_TIMESTAMPTZ_T | rdm_timestamptzZero (void) |
Get the timestamp of the epoch. More... | |
The RDM timestamp datatype API. The functions here are located in RDM Base Functionality. Linker option:
-lrdmbase
const char* rdm_timestampDayAbr | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the day abbreviation.
Get the three letter day abbreviation in English from a packed local timestamp.
[in] | ts | RDM timestamp value |
const char* rdm_timestampDayName | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the day name.
Get the day name in English from a packed local timestamp.
[in] | ts | RDM timestamp value |
uint16_t rdm_timestampDayOfMonth | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the day of the month.
Get the day of month from a packed local timestamp.
[in] | ts | RDM timestamp value |
uint16_t rdm_timestampDayOfWeek | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the day of the week.
Get the day of week from a packed local timestamp for a US locale where Sunday is the first day of the week.
[in] | ts | RDM timestamp value |
uint16_t rdm_timestampDayOfYear | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the day of the year.
Get the day of year from a packed local timestamp where January 1st is the first day.
[in] | ts | RDM timestamp value |
void rdm_timestampDaysDiff | ( | RDM_PACKED_TIMESTAMP_T | start, |
RDM_PACKED_TIMESTAMP_T | end, | ||
uint32_t * | diff | ||
) |
#include <rdmtimestampapi.h>
Get the difference between two timestamps.
Get the difference between two timestamps measured in the number of whole days.
[in] | start | start timestamp |
[in] | end | end timestamp |
[out] | diff | The difference in whole number of days |
uint16_t rdm_timestampFraction | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.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] | ts | RDM timestamp value |
RDM_RETCODE rdm_timestampFromString | ( | const char * | str, |
RDM_DATE_FORMAT | date_fmt, | ||
RDM_PACKED_TIMESTAMP_T * | ptv | ||
) |
#include <rdmtimestampapi.h>
Convert from a string to a timestamp.
Convert a string to a packed local timestamp.
sOKAY | Normal, successful return. |
eBASE_INVDATE | Invalid date value. |
eINVDATEFMT | Invalid date format. |
[in] | str | timestamp value in string |
[in] | date_fmt | RDM date format |
[out] | ptv | The packed local timestamp |
uint16_t rdm_timestampHour | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the hour of the day.
Get the hour from a packed local timestamp.
[in] | ts | RDM timestamp value |
uint16_t rdm_timestampMinute | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the minute of the hour.
Get the minute of the hour from a packed local timestamp.
[in] | ts | RDM timestamp value |
uint16_t rdm_timestampMonth | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the day of the month.
Get the day of month from a packed local timestamp.
[in] | ts | RDM timestamp value |
const char* rdm_timestampMonthAbr | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the month abbreviation.
Get the three letter month abbreviation in English
[in] | ts | RDM timestamp value |
const char* rdm_timestampMonthName | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the month name.
Get the month name in English from a packed local timestamp.
[in] | ts | RDM timestamp value |
RDM_RETCODE rdm_timestampNow | ( | int16_t | time_zone, |
RDM_PACKED_TIMESTAMP_T * | ts | ||
) |
#include <rdmtimestampapi.h>
Get the current local timestamp.
Get the current local timestamp for a timezone.
sOKAY | Normal, successful return. |
eBASE_INVTIMEZONE | Invalid time zone value. |
[in] | time_zone | Timezone value (in min) |
[out] | ts | local timestamp value |
double rdm_timestampNowAsDouble | ( | void | ) |
#include <rdmtimestampapi.h>
Get the current timestamp as a double.
Get the current timestamp as a double.
RDM_RETCODE rdm_timestampNowAsString | ( | int16_t | time_zone, |
char * | tsbuf, | ||
size_t | buflen | ||
) |
#include <rdmtimestampapi.h>
Get the current local timestamp as string.
Get the current local timestamp 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] | tsbuf | NOW value in string |
[in] | buflen | Size of tsbuf in number of ASCII characters it can hold |
uint16_t rdm_timestampQuarter | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the quarter of the year.
Get the quarter of the year from a packed local timestamp.
[in] | ts | RDM timestamp value |
uint16_t rdm_timestampSecond | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the second of the minute.
Get the second of the minute from a packed local timestamp.
[in] | ts | RDM timestamp value |
RDM_RETCODE rdm_timestampToString | ( | RDM_PACKED_TIMESTAMP_T | tmsv, |
RDM_DATE_FORMAT | date_fmt, | ||
char | date_sep, | ||
RDM_TIME_FORMAT | time_fmt, | ||
char * | buf, | ||
size_t | bufSize, | ||
size_t * | puSize | ||
) |
#include <rdmtimestampapi.h>
Convert a timestamp to a string.
Convert a packed local timestamp to a string.
sOKAY | Normal, successful return. |
eBASE_INVDATE | Invalid date value. |
eINVDATESEP | Invalid date separator. |
sTRUNCATE | Result is truncated. |
RDM_RETCODE rdm_timestamptzFromString | ( | const char * | str, |
RDM_DATE_FORMAT | date_fmt, | ||
RDM_PACKED_TIMESTAMPTZ_T * | ptsz | ||
) |
#include <rdmtimestamptzapi.h>
Convert from a string to a timestamp with timezone.
Convert a string to a packed timestamp with timezone.
sOKAY | Normal, successful return. |
eBASE_INVDATE | Invalid date value. |
eINVDATEFMT | Invalid date format. |
[in] | str | timestamp value in string |
[in] | date_fmt | RDM date format |
[out] | ptsz | result timestamp value |
RDM_RETCODE rdm_timestamptzFromTimestamp | ( | RDM_PACKED_TIMESTAMP_T | tsVal, |
int16_t | tz, | ||
RDM_PACKED_TIMESTAMPTZ_T * | pTszVal | ||
) |
#include <rdmtimestamptzapi.h>
Convert a local timestamp to timestamp with timezone.
Convert a local timestamp to timestamp with timezone.
sOKAY | Normal, successful return. |
eBASE_INVTIMEZONE | Invalid time zone value. |
[in] | tsVal | local timestamp value |
[in] | tz | timezone offset (in minutes) |
[out] | pTszVal | resulting timestamp with timezone value |
RDM_RETCODE rdm_timestamptzNow | ( | int16_t | time_zone, |
RDM_PACKED_TIMESTAMPTZ_T * | tsz | ||
) |
#include <rdmtimestamptzapi.h>
Get the current timestamp with timezone.
Get the current timestamp with timezone.
sOKAY | Normal, successful return. |
eBASE_INVTIMEZONE | Invalid time zone value. |
[in] | time_zone | Timezone value (in min) |
[out] | tsz | current timestamp with timezone |
RDM_RETCODE rdm_timestamptzNowAsString | ( | int16_t | time_zone, |
char * | tszbuf, | ||
size_t | buflen | ||
) |
#include <rdmtimestamptzapi.h>
Get the current timestamp with timezone as string.
Get the current timestamp with timezone.
sOKAY | Normal, successful return. |
eBASE_INVTIMEZONE | Invalid time zone value. |
sTRUNCATE | Result is truncated. |
[in] | time_zone | Timezone value (in min) |
[out] | tszbuf | NOW value in string |
[in] | buflen | Size of tsbuf in number of ASCII characters it can hold |
RDM_RETCODE rdm_timestamptzToString | ( | RDM_PACKED_TIMESTAMPTZ_T | tszVal, |
RDM_DATE_FORMAT | date_format, | ||
char | date_sep, | ||
RDM_TIME_FORMAT | time_format, | ||
char * | buf, | ||
size_t | bufSize, | ||
size_t * | puSize | ||
) |
#include <rdmtimestamptzapi.h>
Convert a timestamp with timezone to a string.
Convert a packed timestamp with timezone to a string.
sOKAY | Normal, successful return. |
eBASE_INVDATE | Invalid date value. |
eINVDATESEP | Invalid date separator. |
sTRUNCATE | Result is truncated. |
[in] | tszVal | RDM timestamp with timezone value |
[in] | date_format | RDM date format |
[in] | date_sep | date separator |
[in] | time_format | RDM time format |
[out] | buf | result timestamp with timezone string |
[in] | bufSize | buffer size in number of ASCII characters it can hold |
[out] | puSize | resulting size in number of characters |
RDM_RETCODE rdm_timestamptzToTimestamp | ( | RDM_PACKED_TIMESTAMPTZ_T | tstzVal, |
int16_t | tz_disp, | ||
RDM_PACKED_TIMESTAMP_T * | pTsVal | ||
) |
#include <rdmtimestamptzapi.h>
Convert a timestamp with timezone to a string.
Convert a packed timestamp with timezone to local timestamp.
sOKAY | Normal, successful return. |
[in] | tstzVal | timestamp with timezone value |
[in] | tz_disp | local timezone |
[out] | pTsVal | resulting local timestamp value |
RDM_PACKED_TIMESTAMPTZ_T rdm_timestamptzZero | ( | void | ) |
#include <rdmtimestamptzapi.h>
Get the timestamp of the epoch.
Get the timestamp with timezone of the epoch.
uint16_t rdm_timestampWeek | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the week of the year.
Get the week of the year in US locale.
[in] | ts | RDM timestamp value |
int32_t rdm_timestampYear | ( | RDM_PACKED_TIMESTAMP_T | ts | ) |
#include <rdmtimestampapi.h>
Get the year.
Get the year from a packed local timestamp.
RDM_PACKED_TIMESTAMP_T rdm_timestampZero | ( | void | ) |
#include <rdmtimestampapi.h>
Get the timestamp of the epoch.
Get the local timestamp of the epoch.