Products Support Documentation Download
rdmtimestampapi.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(RDMTIMESTAMPAPI_H_INCLUDED_)
18 #define RDMTIMESTAMPAPI_H_INCLUDED_
19 
20 #if defined(__cplusplus) && !defined(CPP_HEADER_INCLUDED)
21 #error rdmtimestampapi.h is only for C applications. Do not include it directly in C++ applications. Use cpp-rdmtimestampapi.h instead
22 #endif
23 
24 #include "rdmdatetimetypes.h"
25 #include "rdmretcodetypes.h"
26 
27 #if !defined(RDM_NO_UNICODE)
28 #define rdm_timestampDayAbr RDM_T_FUNC(rdm_timestampDayAbr)
29 #define rdm_timestampDayName RDM_T_FUNC(rdm_timestampDayName)
30 #define rdm_timestampFromString RDM_T_FUNC(rdm_timestampFromString)
31 #define rdm_timestampMonthAbr RDM_T_FUNC(rdm_timestampMonthAbr)
32 #define rdm_timestampMonthName RDM_T_FUNC(rdm_timestampMonthName)
33 #define rdm_timestampNowAsString RDM_T_FUNC(rdm_timestampNowAsString)
34 #define rdm_timestampToString RDM_T_FUNC(rdm_timestampToString)
35 #endif
36 
37 
53 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampDayAbr (
55  )
56 ;
57 
64 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampDayName (
66  )
67 ;
68 
75 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampDayOfMonth (
77  )
78 ;
79 
87 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampDayOfWeek (
89  )
90 ;
91 
99 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampDayOfYear (
101  )
102 ;
103 
108 RDM_EXPORT void EXTERNAL_FCN rdm_timestampDaysDiff (
109  RDM_PACKED_TIMESTAMP_T start,
111  uint32_t *diff
112  )
113 ;
114 
123 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampFromString (
124  const RDM_TCHAR_T *str,
125  RDM_DATE_FORMAT date_fmt,
127  )
128 ;
129 
136 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampHour (
138  )
139 ;
140 
147 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampMinute (
149  )
150 ;
151 
158 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampSecond (
160  )
161 ;
162 
169 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampFraction (
171  )
172 ;
173 
180 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampMonth (
182  )
183 ;
184 
191 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampMonthAbr (
193  )
194 ;
195 
202 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampMonthName (
204  )
205 ;
206 
216 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampNow (
217  int16_t time_zone,
219  )
220 ;
221 
232 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampNowAsString (
233  int16_t time_zone,
234  RDM_TCHAR_T *tsbuf,
235  size_t buflen
236  )
237 ;
238 
245 RDM_EXPORT double EXTERNAL_FCN rdm_timestampNowAsDouble (
246  void)
247 ;
248 
255 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampQuarter (
257  )
258 ;
259 
269 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampToString (
271  RDM_DATE_FORMAT date_fmt,
272  RDM_TCHAR_T date_sep,
273  RDM_TIME_FORMAT time_fmt,
274  RDM_TCHAR_T *buf,
275  size_t bufSize,
276  size_t *puSize
277  )
278 ;
279 
286 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampWeek (
288  )
289 ;
290 
297 RDM_EXPORT int32_t EXTERNAL_FCN rdm_timestampYear (
299 ;
300 
307 RDM_EXPORT RDM_PACKED_TIMESTAMP_T EXTERNAL_FCN rdm_timestampZero (
308  void)
309 ;
310 
313 #endif /* RDMTIMESTAMPAPI_H_INCLUDED_ */
double rdm_timestampNowAsDouble(void)
Get the current timestamp as a double.
uint16_t rdm_timestampDayOfWeek(RDM_PACKED_TIMESTAMP_T ts)
Get the day of the week.
RDM_RETCODE rdm_timestampNow(int16_t time_zone, RDM_PACKED_TIMESTAMP_T *ts)
Get the current local timestamp.
int32_t rdm_timestampYear(RDM_PACKED_TIMESTAMP_T ts)
Get the year.
RDM_DATE_FORMAT
RDM Date format codes.
const RDM_TCHAR_T * rdm_timestampMonthName(RDM_PACKED_TIMESTAMP_T ts)
Get the month name.
RDM Status and Error Return Codes.
uint16_t rdm_timestampMinute(RDM_PACKED_TIMESTAMP_T ts)
Get the minute of the hour.
const RDM_TCHAR_T * rdm_timestampDayAbr(RDM_PACKED_TIMESTAMP_T ts)
Get the day abbreviation.
uint16_t rdm_timestampFraction(RDM_PACKED_TIMESTAMP_T ts)
Get the fractions of the second.
RDM_RETCODE rdm_timestampToString(RDM_PACKED_TIMESTAMP_T tmsv, RDM_DATE_FORMAT date_fmt, RDM_TCHAR_T date_sep, RDM_TIME_FORMAT time_fmt, RDM_TCHAR_T *buf, size_t bufSize, size_t *puSize)
Convert a timestamp to a string.
uint16_t rdm_timestampSecond(RDM_PACKED_TIMESTAMP_T ts)
Get the second of the minute.
const RDM_TCHAR_T * rdm_timestampDayName(RDM_PACKED_TIMESTAMP_T ts)
Get the day name.
RDM_RETCODE rdm_timestampFromString(const RDM_TCHAR_T *str, RDM_DATE_FORMAT date_fmt, RDM_PACKED_TIMESTAMP_T *ptv)
Convert from a string to a timestamp.
RDM_RETCODE
RDM status and error return codes.
const RDM_TCHAR_T * rdm_timestampMonthAbr(RDM_PACKED_TIMESTAMP_T ts)
Get the month abbreviation.
uint16_t rdm_timestampQuarter(RDM_PACKED_TIMESTAMP_T ts)
Get the quarter of the year.
uint16_t rdm_timestampWeek(RDM_PACKED_TIMESTAMP_T ts)
Get the week of the year.
uint16_t rdm_timestampHour(RDM_PACKED_TIMESTAMP_T ts)
Get the hour of the day.
RDM_RETCODE rdm_timestampNowAsString(int16_t time_zone, RDM_TCHAR_T *tsbuf, size_t buflen)
Get the current local timestamp as string.
uint16_t rdm_timestampDayOfMonth(RDM_PACKED_TIMESTAMP_T ts)
Get the day of the month.
The RDM packed Timestamp data structure.
uint16_t rdm_timestampMonth(RDM_PACKED_TIMESTAMP_T ts)
Get the day of the month.
void rdm_timestampDaysDiff(RDM_PACKED_TIMESTAMP_T start, RDM_PACKED_TIMESTAMP_T end, uint32_t *diff)
Get the difference between two timestamps.
Header for the public Date/Time types.
#define RDM_TCHAR_T
Definition: psptypes.h:134
uint16_t rdm_timestampDayOfYear(RDM_PACKED_TIMESTAMP_T ts)
Get the day of the year.
RDM_PACKED_TIMESTAMP_T rdm_timestampZero(void)
Get the timestamp of the epoch.
RDM_TIME_FORMAT
RDM time format codes.