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 ;
58 
65 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateDayName (
67  )
68 ;
69 
76 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateDayOfMonth (
78  )
79 ;
80 
88 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateDayOfWeek (
90  )
91 ;
92 
100 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateDayOfYear (
102  )
103 ;
104 
113 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateFromString (
114  const RDM_TCHAR_T *str,
115  RDM_DATE_FORMAT date_fmt,
116  RDM_PACKED_DATE_T *pdv
117  )
118 ;
119 
126 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateMonth (
128  )
129 ;
130 
137 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateMonthAbr (
139  )
140 ;
141 
148 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateMonthName (
150  )
151 ;
152 
162 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateNowAsString (
163  int16_t time_zone,
164  RDM_TCHAR_T *datebuf,
165  size_t buflen
166  )
167 ;
168 
175 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateQuarter (
177  )
178 ;
179 
189 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateToday (
190  int16_t time_zone,
191  RDM_PACKED_DATE_T *pdt
192  )
193 ;
194 
204 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateToString (
205  RDM_PACKED_DATE_T dateVal,
206  RDM_DATE_FORMAT date_fmt,
207  RDM_TCHAR_T date_sep,
208  RDM_TCHAR_T *buf,
209  size_t bufSize,
210  size_t *puSize
211  )
212 ;
213 
220 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateWeek (
222  )
223 ;
224 
231 RDM_EXPORT int32_t EXTERNAL_FCN rdm_dateYear (
233  )
234 ;
235 
242 RDM_EXPORT RDM_PACKED_DATE_T EXTERNAL_FCN rdm_dateZero (
243  void)
244 ;
245 
248 #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.