8 #include <grass/datetime.h>
11 extern struct tm *
gmtime();
35 struct tm *local, *gm;
37 DateTime dtl, dtg, dtdiff;
68 DATETIME_DAY, DATETIME_SECOND, 0);
72 *minutes = dtdiff.positive ? dtdiff.minute : -dtdiff.minute;
int datetime_set_hour(DateTime *dt, int hour)
returns 0 on success or negative value on error
int datetime_set_day(DateTime *dt, int day)
if dt.mode = ABSOLUTE, then the dt.year, dt.month:
int datetime_set_type(DateTime *dt, int mode, int from, int to, int fracsec)
int datetime_set_year(DateTime *dt, int year)
if dt.mode = ABSOLUTE, this also sets dt.day = 0
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_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_month(DateTime *dt, int month)
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_set_minute(DateTime *dt, int minute)
returns 0 on success or negative value on error
int datetime_difference(const DateTime *a, const DateTime *b, DateTime *result)
This performs the formula: result = a - b;.
int datetime_get_local_timezone(int *minutes)
Returns: 0 OK -1 local timezone info not available.