Macros | |
#define | RDM_DATE_MAX RDM_UINT32_MAX |
Functions | |
const char * | rdm_dateDayAbr (RDM_PACKED_DATE_T dt) |
Get the day abbreviation. More... | |
const char * | rdm_dateDayName (RDM_PACKED_DATE_T dt) |
Get the day name. More... | |
uint16_t | rdm_dateDayOfMonth (RDM_PACKED_DATE_T dt) |
Get the day of the month. More... | |
uint16_t | rdm_dateDayOfWeek (RDM_PACKED_DATE_T dt) |
Get the day of the week. More... | |
uint16_t | rdm_dateDayOfYear (RDM_PACKED_DATE_T dt) |
Get the day of the year. More... | |
RDM_RETCODE | rdm_dateFromString (const char *str, RDM_DATE_FORMAT date_fmt, RDM_PACKED_DATE_T *pdv) |
Convert from a string to a date. More... | |
uint16_t | rdm_dateMonth (RDM_PACKED_DATE_T dt) |
Get the month. More... | |
const char * | rdm_dateMonthAbr (RDM_PACKED_DATE_T dt) |
Get the month abbreviation. More... | |
const char * | rdm_dateMonthName (RDM_PACKED_DATE_T dt) |
Get the month name. More... | |
RDM_RETCODE | rdm_dateNowAsString (int16_t time_zone, char *datebuf, size_t buflen) |
Get the current date as a string. More... | |
uint16_t | rdm_dateQuarter (RDM_PACKED_DATE_T dt) |
Get the quarter of the year. More... | |
RDM_RETCODE | rdm_dateToday (int16_t time_zone, RDM_PACKED_DATE_T *pdt) |
Get the current date. More... | |
RDM_RETCODE | rdm_dateToString (RDM_PACKED_DATE_T dateVal, RDM_DATE_FORMAT date_fmt, char date_sep, char *buf, size_t bufSize, size_t *puSize) |
Convert a date to a string. More... | |
uint16_t | rdm_dateWeek (RDM_PACKED_DATE_T dt) |
Get the week of the year. More... | |
int32_t | rdm_dateYear (RDM_PACKED_DATE_T dt) |
Get the year. More... | |
RDM_PACKED_DATE_T | rdm_dateZero (void) |
Get the date of the epoch. More... | |
The RDM date datatype API. The functions here are located in RDM Base Functionality. Linker option:
-lrdmbase
#define RDM_DATE_MAX RDM_UINT32_MAX |
#include <rdmdateapi.h>
const char* rdm_dateDayAbr | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the day abbreviation.
Get the three letter day abbreviation in English from a packed date.
[in] | dt | RDM date value |
const char* rdm_dateDayName | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the day name.
Get the day name in English from a packed date.
[in] | dt | RDM date value |
uint16_t rdm_dateDayOfMonth | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the day of the month.
Get the day of month from a packed date.
[in] | dt | RDM packed date value |
uint16_t rdm_dateDayOfWeek | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the day of the week.
Get the day of week from a packed date for a US locale where Sunday is the first day of the week.
[in] | dt | RDM packed date value |
uint16_t rdm_dateDayOfYear | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the day of the year.
Get the day of year from a packed date where January 1st is the first day.
[in] | dt | RDM packed date value |
RDM_RETCODE rdm_dateFromString | ( | const char * | str, |
RDM_DATE_FORMAT | date_fmt, | ||
RDM_PACKED_DATE_T * | pdv | ||
) |
#include <rdmdateapi.h>
Convert from a string to a date.
Convert a string to a packed date.
sOKAY | Normal, successful return. |
eBASE_INVDATE | Invalid date value. |
eINVDATEFMT | Invalid date format. |
[in] | str | The date as a string that is to be converted |
[in] | date_fmt | The date format |
[out] | pdv | RDM packed date value. The buffer need to be allocated by the caller. |
uint16_t rdm_dateMonth | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the month.
Get the month from a packed date.
[in] | dt | RDM packed date value |
const char* rdm_dateMonthAbr | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the month abbreviation.
Get the three letter month abbreviation in English.
[in] | dt | RDM date value |
const char* rdm_dateMonthName | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the month name.
Get the month name in English from a packed date.
[in] | dt | RDM date value |
RDM_RETCODE rdm_dateNowAsString | ( | int16_t | time_zone, |
char * | datebuf, | ||
size_t | buflen | ||
) |
#include <rdmdateapi.h>
Get the current date as a string.
Get the current local date as a string.
sOKAY | Normal, successful return. |
eBASE_INVTIMEZONE | Invalid time zone value. |
[in] | time_zone | local timezone (in min) |
[out] | datebuf | NOW value in string |
[in] | buflen | size of datebuf in number of ASCII characters it can hold |
uint16_t rdm_dateQuarter | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the quarter of the year.
Get the quarter of the year from a packed date.
[in] | dt | RDM packed date value |
RDM_RETCODE rdm_dateToday | ( | int16_t | time_zone, |
RDM_PACKED_DATE_T * | pdt | ||
) |
#include <rdmdateapi.h>
Get the current date.
Get the current date based for a time zone.
sOKAY | Normal, successful return. |
eBASE_INVTIMEZONE | Invalid time zone value. |
[in] | time_zone | local timezone value (in min) |
[out] | pdt | current date adjusted with time_zone |
RDM_RETCODE rdm_dateToString | ( | RDM_PACKED_DATE_T | dateVal, |
RDM_DATE_FORMAT | date_fmt, | ||
char | date_sep, | ||
char * | buf, | ||
size_t | bufSize, | ||
size_t * | puSize | ||
) |
#include <rdmdateapi.h>
Convert a date to a string.
Convert a packed date to a string.
sOKAY | Normal, successful return. |
eBASE_INVDATE | Invalid date value. |
eINVDATESEP | Invalid date separator. |
sTRUNCATE | Result is truncated. |
uint16_t rdm_dateWeek | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the week of the year.
Get the week of the year in US locale.
[in] | dt | RDM packed date value |
int32_t rdm_dateYear | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the year.
Get the year from a packed date.
[in] | dt | RDM packed date value |
RDM_PACKED_DATE_T rdm_dateZero | ( | void | ) |
#include <rdmdateapi.h>
Get the date of the epoch.
Get the date of the epoch in packed date format.