43 static int _datetime_ymd_to_ddays(
const DateTime *,
double *);
101 "only one opperand contains valid timezone");
108 compare = _datetime_compare(&ta, &tb);
114 else if (compare < 0) {
139 result->
month = dm + 12;
144 double latedays, earlydays;
147 _datetime_ymd_to_ddays(early, &earlydays);
149 erel.
day = earlydays;
155 _datetime_ymd_to_ddays(late, &latedays);
194 for (i = a->
from; i <= a->to; i++) {
255 static int _datetime_ymd_to_ddays(
const DateTime * dtymd,
double *days)
263 *days = dtymd->
day - 1;
264 for (mo = dtymd->
month - 1; mo > 0; mo--) {
267 for (yr = dtymd->
year - 1; yr > 0; yr--) {
272 for (yr = dtymd->
year - 1; yr > 0; yr--) {
275 for (mo = 12; mo >= dtymd->
month; mo--) {
int datetime_get_timezone(const DateTime *dt, int *minutes)
returns 0 on success
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 ...
#define DATETIME_RELATIVE
int datetime_change_to_utc(DateTime *dt)
Return datetime_change_timezone (dt, 0);.
void datetime_copy(DateTime *src, const DateTime *dst)
Copies the DateTime [into/from ???] src.
void datetime_invert_sign(DateTime *dt)
int datetime_days_in_year(int year, int ad)
returns the number of days in 'year'
int datetime_days_in_month(int year, int month, int ad)
returns number of days in 'month' of a particular 'year'
int datetime_set_type(DateTime *dt, int mode, int from, int to, int fracsec)
int datetime_difference(const DateTime *a, const DateTime *b, DateTime *result)
This performs the formula: result = a - b;.
int datetime_set_increment_type(const DateTime *src, DateTime *incr)
src must be legal This is a convenience routine which is implemented as follows:
int compare(const void *a, const void *b)
int datetime_in_interval_year_month(int x)
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_increment(DateTime *src, DateTime *incr)
This function changes the 'src' date/time data based on the 'incr' The type (mode/from/to) of the 'sr...