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 #include "rdmdatetimetypes.h"
18 #include "rdmretcodetypes.h"
19 
20 #if defined(RDM_UNICODE)
21 #define rdm_timestampDayAbr RDM_T_FUNC (rdm_timestampDayAbr)
22 #define rdm_timestampDayName RDM_T_FUNC (rdm_timestampDayName)
23 #define rdm_timestampFromString RDM_T_FUNC (rdm_timestampFromString)
24 #define rdm_timestampMonthAbr RDM_T_FUNC (rdm_timestampMonthAbr)
25 #define rdm_timestampMonthName RDM_T_FUNC (rdm_timestampMonthName)
26 #define rdm_timestampNowAsString RDM_T_FUNC (rdm_timestampNowAsString)
27 #define rdm_timestampToString RDM_T_FUNC (rdm_timestampToString)
28 #endif
29 
39 #if defined(__cplusplus)
40 extern "C" {
41 #endif
42 
49 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampDayAbr (
51 );
52 
59 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampDayName (
61 );
62 
69 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampDayOfMonth (
71 );
72 
80 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampDayOfWeek (
82 );
83 
91 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampDayOfYear (
93 );
94 
99 RDM_EXPORT void EXTERNAL_FCN rdm_timestampDaysDiff (
100  RDM_PACKED_TIMESTAMP_T start,
102  uint32_t *diff
103 );
104 
113 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampFromString (
114  const RDM_TCHAR_T *str,
115  RDM_DATE_FORMAT date_fmt,
117 );
118 
125 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampHour (
127 );
128 
135 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampMinute (
137 );
138 
145 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampSecond (
147 );
148 
155 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampFraction (
157 );
158 
165 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampMonth (
167 );
168 
175 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampMonthAbr (
177 );
178 
185 RDM_EXPORT const RDM_TCHAR_T *EXTERNAL_FCN rdm_timestampMonthName (
187 );
188 
198 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampNow (
199  int16_t time_zone,
201 );
202 
213 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampNowAsString (
214  int16_t time_zone,
215  RDM_TCHAR_T *tsbuf,
216  size_t buflen
217 );
218 
225 RDM_EXPORT double EXTERNAL_FCN rdm_timestampNowAsDouble (void);
226 
233 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampQuarter (
235 );
236 
246 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_timestampToString (
248  RDM_DATE_FORMAT date_fmt,
249  RDM_TCHAR_T date_sep,
250  RDM_TIME_FORMAT time_fmt,
251  RDM_TCHAR_T *buf,
252  size_t bufSize,
253  size_t *puSize
254 );
255 
262 RDM_EXPORT uint16_t EXTERNAL_FCN rdm_timestampWeek (
264 );
265 
272 RDM_EXPORT int32_t EXTERNAL_FCN rdm_timestampYear (RDM_PACKED_TIMESTAMP_T ts);
273 
280 RDM_EXPORT RDM_PACKED_TIMESTAMP_T EXTERNAL_FCN rdm_timestampZero (void);
281 
282 #if defined(__cplusplus)
283 }
284 #endif
285 
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.