Products Support Documentation Download
rdmdateapi.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * Raima Database Manager
3  *
4  * Copyright (c) 2010 Raima Inc., All rights reserved.
5  *
6  * Use of this software, whether in source code format, or in executable,
7  * binary object code form, is governed by the Raima LICENSE which
8  * is fully described in the LICENSE.TXT file, included within this
9  * distribution of files.
10  * ----------------------------------------------------------------------------
11  */
12 
17 #if !defined(RDMDATEAPI_H_INCLUDED_)
18 #define RDMDATEAPI_H_INCLUDED_
19 
20 #if defined(__cplusplus) && !defined(CPP_HEADER_INCLUDED)
21 #error rdmdateapi.h is only for C applications. Do not include it directly in C++ applications. Use cpp-rdmdateapi.h instead
22 #endif
23 
24 #include "rdmdatetimetypes.h"
25 #include "rdmretcodetypes.h"
26 
27 #if !defined(RDM_NO_UNICODE)
28 #define rdm_dateDayAbr RDM_T_FUNC(rdm_dateDayAbr)
29 #define rdm_dateDayName RDM_T_FUNC(rdm_dateDayName)
30 #define rdm_dateFromString RDM_T_FUNC(rdm_dateFromString)
31 #define rdm_dateMonthAbr RDM_T_FUNC(rdm_dateMonthAbr)
32 #define rdm_dateMonthName RDM_T_FUNC(rdm_dateMonthName)
33 #define rdm_dateNowAsString RDM_T_FUNC(rdm_dateNowAsString)
34 #define rdm_dateToString RDM_T_FUNC(rdm_dateToString)
35 #endif
36 
46 #define RDM_DATE_MAX RDM_UINT32_MAX
47 
54 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateDayAbr (
56 ;
57 
64 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateDayName (
66 ;
67 
74 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateDayOfMonth (
76 ;
77 
85 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateDayOfWeek (
87 ;
88 
96 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateDayOfYear (
98 ;
99 
108 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateFromString (
109  const RDM_TCHAR_T *str,
110  RDM_DATE_FORMAT date_fmt,
111  RDM_PACKED_DATE_T *pdv)
112 ;
113 
120 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateMonth (
121  RDM_PACKED_DATE_T dt)
122 ;
123 
130 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateMonthAbr (
131  RDM_PACKED_DATE_T dt)
132 ;
133 
140 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateMonthName (
141  RDM_PACKED_DATE_T dt)
142 ;
143 
153 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateNowAsString (
154  int16_t time_zone,
155  RDM_TCHAR_T *datebuf,
156  size_t buflen)
157 ;
158 
165 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateQuarter (
166  RDM_PACKED_DATE_T dt)
167 ;
168 
178 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateToday (
179  int16_t time_zone,
180  RDM_PACKED_DATE_T *pdt)
181 ;
182 
192 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateToString (
193  RDM_PACKED_DATE_T dateVal,
194  RDM_DATE_FORMAT date_fmt,
195  RDM_TCHAR_T date_sep,
196  RDM_TCHAR_T *buf,
197  size_t bufSize,
198  size_t *puSize)
199 ;
200 
207 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateWeek (
208  RDM_PACKED_DATE_T dt)
209 ;
210 
217 RDM_EXPORT int32_t EXTERNAL_FCN rdm_dateYear (
218  RDM_PACKED_DATE_T dt)
219 ;
220 
227 RDM_EXPORT RDM_PACKED_DATE_T EXTERNAL_FCN rdm_dateZero (
228  void)
229 ;
230 
233 #endif /* RDMDATEAPI_H_INCLUDED_ */
int32_t rdm_dateYear(RDM_PACKED_DATE_T dt)
Get the year.
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.
uint16_t rdm_dateMonth(RDM_PACKED_DATE_T dt)
Get the month.
const RDM_TCHAR_T * rdm_dateDayAbr(RDM_PACKED_DATE_T dt)
Get the day abbreviation.
const RDM_TCHAR_T * rdm_dateMonthName(RDM_PACKED_DATE_T dt)
Get the month name.
RDM_DATE_FORMAT
RDM Date format codes.
RDM_RETCODE rdm_dateToday(int16_t time_zone, RDM_PACKED_DATE_T *pdt)
Get the current date.
RDM Status and Error Return Codes.
uint16_t rdm_dateDayOfMonth(RDM_PACKED_DATE_T dt)
Get the day of the month.
RDM_RETCODE rdm_dateNowAsString(int16_t time_zone, RDM_TCHAR_T *datebuf, size_t buflen)
Get the current date as a string.
RDM_RETCODE
RDM status and error return codes.
uint16_t rdm_dateDayOfYear(RDM_PACKED_DATE_T dt)
Get the day of the year.
uint16_t rdm_dateDayOfWeek(RDM_PACKED_DATE_T dt)
Get the day of the week.
uint32_t RDM_PACKED_DATE_T
The RDM packed Date data structure.
const RDM_TCHAR_T * rdm_dateMonthAbr(RDM_PACKED_DATE_T dt)
Get the month abbreviation.
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.
RDM_PACKED_DATE_T rdm_dateZero(void)
Get the date of the epoch.
uint16_t rdm_dateQuarter(RDM_PACKED_DATE_T dt)
Get the quarter of the year.
Header for the public Date/Time types.
#define RDM_TCHAR_T
Definition: psptypes.h:134
const RDM_TCHAR_T * rdm_dateDayName(RDM_PACKED_DATE_T dt)
Get the day name.
uint16_t rdm_dateWeek(RDM_PACKED_DATE_T dt)
Get the week of the year.