7 #include <grass/datetime.h>
42 dt->fracsec = fracsec;
64 *fracsec = dt->fracsec;
122 case DATETIME_ABSOLUTE:
123 case DATETIME_RELATIVE:
133 if (dt->from > dt->to)
135 if (dt->mode == DATETIME_RELATIVE) {
143 if (dt->mode == DATETIME_ABSOLUTE && dt->from != DATETIME_YEAR)
145 if (dt->to == DATETIME_SECOND && dt->fracsec < 0)
175 return (dt->mode == DATETIME_ABSOLUTE);
192 return (dt->mode == DATETIME_RELATIVE);
int datetime_set_type(DateTime *dt, int mode, int from, int to, int fracsec)
int datetime_in_interval_day_second(int x)
int datetime_is_between(int x, int a, int b)
int datetime_check_type(const DateTime *dt)
checks the mode/from/to/fracsec in dt. Returns:
int datetime_is_relative(const DateTime *dt)
Returns: 1 if dt.mode is relative 0 if not (even if dt.mode is not defined)
int datetime_error(int code, char *msg)
record 'code' and 'msg' as error code/msg (in static variables) code==0 will clear the error (ie set ...
int datetime_is_absolute(const DateTime *dt)
Returns: 1 if dt.mode is absolute 0 if not (even if dt.mode is not defined)
int datetime_is_valid_type(const DateTime *dt)
Returns: 1 if datetime_check_type() returns 0 0 if not.
int datetime_unset_timezone(DateTime *dt)
unsets timezone in 'dt' returns 0
int datetime_get_type(const DateTime *dt, int *mode, int *from, int *to, int *fracsec)
int datetime_in_interval_year_month(int x)