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 #include "rdmdatetimetypes.h"
18 #include "rdmretcodetypes.h"
19 
20 #if defined(RDM_UNICODE)
21 #define rdm_dateDayAbr RDM_T_FUNC (rdm_dateDayAbr)
22 #define rdm_dateDayName RDM_T_FUNC (rdm_dateDayName)
23 #define rdm_dateFromString RDM_T_FUNC (rdm_dateFromString)
24 #define rdm_dateMonthAbr RDM_T_FUNC (rdm_dateMonthAbr)
25 #define rdm_dateMonthName RDM_T_FUNC (rdm_dateMonthName)
26 #define rdm_dateNowAsString RDM_T_FUNC (rdm_dateNowAsString)
27 #define rdm_dateToString RDM_T_FUNC (rdm_dateToString)
28 #endif
29 
39 #define RDM_DATE_MAX RDM_UINT32_MAX
40 
41 #if defined(__cplusplus)
42 extern "C" {
43 #endif
44 
51 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateDayAbr (
53 );
54 
61 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateDayName (
63 );
64 
71 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateDayOfMonth (
73 );
74 
82 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateDayOfWeek (
84 );
85 
93 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateDayOfYear (
95 );
96 
105 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateFromString (
106  const RDM_TCHAR_T *str,
107  RDM_DATE_FORMAT date_fmt,
108  RDM_PACKED_DATE_T *pdv
110 );
111 
118 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateMonth (
120 );
121 
128 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateMonthAbr (
130 );
131 
138 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_dateMonthName (
140 );
141 
151 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateNowAsString (
152  int16_t time_zone,
153  RDM_TCHAR_T *datebuf,
154  size_t buflen
155 );
156 
163 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateQuarter (
165 );
166 
176 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateToday (
177  int16_t time_zone,
178  RDM_PACKED_DATE_T *pdt
179 );
180 
190 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_dateToString (
191  RDM_PACKED_DATE_T dateVal,
192  RDM_DATE_FORMAT date_fmt,
193  RDM_TCHAR_T date_sep,
194  RDM_TCHAR_T *buf,
195  size_t bufSize,
196  size_t *puSize
197 );
198 
205 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_dateWeek (
207 );
208 
215 RDM_EXPORT int32_t EXTERNAL_FCN rdm_dateYear (
217 );
218 
225 RDM_EXPORT RDM_PACKED_DATE_T EXTERNAL_FCN rdm_dateZero (void);
226 
227 #if defined(__cplusplus)
228 }
229 #endif
230 
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:130
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.