00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _OPENSYNC_TIME_H_
00024 #define _OPENSYNC_TIME_H_
00025
00040
00041
00042
00043
00044
00050 OSYNC_EXPORT char *osync_time_timestamp(const char *vtime);
00051
00057 OSYNC_EXPORT char *osync_time_datestamp(const char *vtime);
00058
00063 OSYNC_EXPORT osync_bool osync_time_isdate(const char *vformat);
00064
00069 OSYNC_EXPORT osync_bool osync_time_isutc(const char *vformat);
00070
00073
00074
00085
00091 OSYNC_EXPORT struct tm *osync_time_vtime2tm(const char *vtime);
00092
00102 OSYNC_EXPORT char *osync_time_tm2vtime(const struct tm *time, osync_bool is_utc);
00103
00106
00107
00117
00124 OSYNC_EXPORT time_t osync_time_vtime2unix(const char *vtime, int offset);
00125
00131 OSYNC_EXPORT char *osync_time_unix2vtime(const time_t *timestamp);
00132
00133
00134
00143 OSYNC_EXPORT time_t osync_time_localtm2unix(const struct tm *localtime);
00144
00159 OSYNC_EXPORT time_t osync_time_utctm2unix(const struct tm *utctime);
00160
00168 OSYNC_EXPORT struct tm *osync_time_unix2localtm(const time_t *timestamp);
00169
00177 OSYNC_EXPORT struct tm *osync_time_unix2utctm(const time_t *timestamp);
00178
00181
00182
00195
00204 OSYNC_EXPORT int osync_time_timezone_diff(const struct tm *local);
00205
00215 OSYNC_EXPORT struct tm *osync_time_tm2utc(const struct tm *ltime, int offset);
00216
00226 OSYNC_EXPORT struct tm *osync_time_tm2localtime(const struct tm *utime, int offset);
00227
00234 OSYNC_EXPORT char *osync_time_vtime2utc(const char* localtime, int offset);
00235
00242 OSYNC_EXPORT char *osync_time_vtime2localtime(const char* utc, int offset);
00243
00249 OSYNC_EXPORT int osync_time_utcoffset2sec(const char *offset);
00250
00253
00254
00265
00266
00272 OSYNC_EXPORT char *osync_time_vcal2localtime(const char *vcal);
00273
00279 OSYNC_EXPORT char *osync_time_vcal2utc(const char *vcal);
00280
00281
00284
00285
00293
00299 OSYNC_EXPORT char *osync_time_sec2alarmdu(int seconds);
00300
00309 OSYNC_EXPORT int osync_time_alarmdu2sec(const char *alarm);
00310
00313
00314
00322
00332 OSYNC_EXPORT int osync_time_str2wday(const char *swday);
00333
00350 OSYNC_EXPORT struct tm *osync_time_relative2tm(const char *byday, const int bymonth, const int year);
00351
00352 #ifdef _WIN32
00353
00354
00355
00356 OSYNC_TEST_EXPORT inline struct tm* gmtime_r (const time_t *clock, struct tm *result);
00357 OSYNC_TEST_EXPORT inline struct tm* localtime_r (const time_t *clock, struct tm *result);
00358 #endif
00359
00362 #endif