Macros |
|
#define | RDM_DATE_MAXRDM_UINT32_MAX |
Functions |
|
const RDM_TCHAR_T * | rdm_dateDayAbr (RDM_PACKED_DATE_T dt) |
Get the day abbreviation. More... | |
const RDM_TCHAR_T * | 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 RDM_TCHAR_T *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 RDM_TCHAR_T * | rdm_dateMonthAbr (RDM_PACKED_DATE_T dt) |
Get the month abbreviation. More... | |
const RDM_TCHAR_T * | rdm_dateMonthName (RDM_PACKED_DATE_T dt) |
Get the month name. More... | |
RDM_RETCODE | rdm_dateNowAsString (int16_t time_zone, RDM_TCHAR_T *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, RDM_TCHAR_T date_sep, RDM_TCHAR_T *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... | |
Detailed Description
The RDM date datatype API. The functions here are located in RDM Base Functionality. Linker option:
-l
rdmbase
Macro Definition Documentation
RDM_DATE_MAX
#define RDM_DATE_MAX RDM_UINT32_MAX |
#include <rdmdateapi.h>
Function Documentation
rdm_dateDayAbr()
const RDM_TCHAR_T* 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.
- Returns
- The day abbreviation
- Parameters
-
[in] dt [in] RDM date value
rdm_dateDayName()
const RDM_TCHAR_T* rdm_dateDayName | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the day name.
Get the day name in English from a packed date.
- Returns
- The day name
- Parameters
-
[in] dt [in] RDM date value
rdm_dateDayOfMonth()
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.
- Returns
- The day of month (1 - 31)
- Parameters
-
[in] dt [in] RDM packed date value
rdm_dateDayOfWeek()
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.
- Returns
- The day of month (1 - 7)
- Parameters
-
[in] dt [in] RDM packed date value
rdm_dateDayOfYear()
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.
- Returns
- The day of the year (1 - 366)
- Parameters
-
[in] dt [in] RDM packed date value
rdm_dateFromString()
RDM_RETCODE rdm_dateFromString | ( | const RDM_TCHAR_T * | 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.
- Return values
-
sOKAY Normal, successful return. eBASE_INVDATE Invalid date value. eINVDATEFMT Invalid date format.
- Parameters
-
[in] str [in] The date as a string that is to be converted [in] date_fmt [in] The date format [out] pdv [out] RDM packed date value. The buffer need to be allocated by the caller.
rdm_dateMonth()
uint16_t rdm_dateMonth | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the month.
Get the month from a packed date.
- Returns
- The month (1 - 12)
- Parameters
-
[in] dt [in] RDM packed date value
rdm_dateMonthAbr()
const RDM_TCHAR_T* rdm_dateMonthAbr | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the month abbreviation.
Get the three letter month abbreviation in English.
- Returns
- The month abbreviation
- Parameters
-
[in] dt [in] RDM date value
rdm_dateMonthName()
const RDM_TCHAR_T* rdm_dateMonthName | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the month name.
Get the month name in English from a packed date.
- Returns
- The month name
- Parameters
-
[in] dt [in] RDM date value
rdm_dateNowAsString()
RDM_RETCODE rdm_dateNowAsString | ( | int16_t | time_zone, |
RDM_TCHAR_T * | datebuf, | ||
size_t | buflen | ||
) |
#include <rdmdateapi.h>
Get the current date as a string.
Get the current local date as a string.
- Return values
-
sOKAY Normal, successful return. eBASE_INVTIMEZONE Invalid time zone value.
- See also
- rdm_dateToday
- Parameters
-
[in] time_zone [in] local timezone (in min) [out] datebuf [out] NOW value in string [in] buflen [in] size of datebuf in number of ASCII characters it can hold
rdm_dateQuarter()
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.
- Returns
- The quarter of the year (1 - 4)
- Parameters
-
[in] dt [in] RDM packed date value
rdm_dateToday()
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.
- Return values
-
sOKAY Normal, successful return. eBASE_INVTIMEZONE Invalid time zone value.
- See also
- rdm_dateNowAsString
- Parameters
-
[in] time_zone [in] local timezone value (in min) [out] pdt [out] current date adjusted with time_zone
rdm_dateToString()
RDM_RETCODE rdm_dateToString | ( | RDM_PACKED_DATE_T | dateVal, |
RDM_DATE_FORMAT | date_fmt, | ||
RDM_TCHAR_T | date_sep, | ||
RDM_TCHAR_T * | buf, | ||
size_t | bufSize, | ||
size_t * | puSize | ||
) |
#include <rdmdateapi.h>
Convert a date to a string.
Convert a packed date to a string.
- Return values
-
sOKAY Normal, successful return. eBASE_INVDATE Invalid date value. eINVDATESEP Invalid date separator. sTRUNCATE Result is truncated.
- Parameters
-
[in] dateVal [in] RDM date value [in] date_fmt [in] RDM date format [in] date_sep [in] date separator [out] buf [out] resulting date string [in] bufSize [in] buffer size in number of ASCII characters it can hold [out] puSize [out] resulting size in number of characters
rdm_dateWeek()
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.
- Returns
- The week of the year (1 - 53)
- Parameters
-
[in] dt [in] RDM packed date value
rdm_dateYear()
int32_t rdm_dateYear | ( | RDM_PACKED_DATE_T | dt | ) |
#include <rdmdateapi.h>
Get the year.
Get the year from a packed date.
- Returns
- The year
- Parameters
-
[in] dt [in] RDM packed date value
rdm_dateZero()
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.
- Returns
- The date of the epoch