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 
63 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampDayName (
65 ;
66 
73 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampDayOfMonth (
75 ;
76 
84 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampDayOfWeek (
86 ;
87 
95 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampDayOfYear (
97 ;
98 
103 RDM_EXPORT void EXTERNAL_FCN rdm_timestampDaysDiff (
104  RDM_PACKED_TIMESTAMP_T start,
106  uint32_t *diff)
107 ;
108 
117 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampFromString (
118  const RDM_TCHAR_T *str,
119  RDM_DATE_FORMAT date_fmt,
121 ;
122 
129 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampHour (
131 ;
132 
139 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampMinute (
141 ;
142 
149 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampSecond (
151 ;
152 
159 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampFraction (
161 ;
162 
169 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampMonth (
171 ;
172 
179 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampMonthAbr (
181 ;
182 
189 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampMonthName (
191 ;
192 
202 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampNow (
203  int16_t time_zone,
205 ;
206 
217 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampNowAsString (
218  int16_t time_zone,
219  RDM_TCHAR_T *tsbuf,
220  size_t buflen)
221 ;
222 
229 RDM_EXPORT double EXTERNAL_FCN rdm_timestampNowAsDouble (
230  void)
231 ;
232 
239 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampQuarter (
241 ;
242 
252 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampToString (
254  RDM_DATE_FORMAT date_fmt,
255  RDM_TCHAR_T date_sep,
256  RDM_TIME_FORMAT time_fmt,
257  RDM_TCHAR_T *buf,
258  size_t bufSize,
259  size_t *puSize)
260 ;
261 
268 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampWeek (
270 ;
271 
278 RDM_EXPORT int32_t EXTERNAL_FCN rdm_timestampYear (
280 ;
281 
288 RDM_EXPORT RDM_PACKED_TIMESTAMP_T EXTERNAL_FCN rdm_timestampZero (
289  void)
290 ;
291 
294 #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.