31 struct tm *local, *gm;
37 local = localtime(&clock);
92 local = localtime(&clock);
#define DATETIME_ABSOLUTE
#define DATETIME_RELATIVE
int datetime_difference(const DateTime *a, const DateTime *b, DateTime *result)
This performs the formula: result = a - b;.
int datetime_set_day(DateTime *dt, int day)
if dt.mode = ABSOLUTE, then the dt.year, dt.month:
int datetime_set_month(DateTime *dt, int month)
if dt.mode = ABSOLUTE, this also sets dt.day = 0
int datetime_set_type(DateTime *dt, int mode, int from, int to, int fracsec)
int datetime_set_hour(DateTime *dt, int hour)
returns 0 on success or negative value on error
int datetime_set_year(DateTime *dt, int year)
if dt.mode = ABSOLUTE, this also sets dt.day = 0
int datetime_set_second(DateTime *dt, double second)
returns 0 on success or negative value on error
int datetime_change_from_to(DateTime *dt, int from, int to, int round)
Changes the from/to of the type for dt. The 'from/to' must be legal values for the mode of dt; (if th...
int datetime_set_minute(DateTime *dt, int minute)
returns 0 on success or negative value on error
void datetime_get_local_time(DateTime *dt)
set mode/from/to ABSOLUTE/YEAR/SECOND set the local time into 'dt' does not set timezone.
int datetime_get_local_timezone(int *minutes)
Returns: 0 OK -1 local timezone info not available.