#include <stdlib.h>
#include <grass/datetime.h>
#include "math.h"
Go to the source code of this file.
◆ datetime_difference()
This performs the formula: result = a - b;.
-
both a and b must be absolute.
-
result will be relative
-
If a is "earlier" than b, then result will be set negative.
-
b must be no more "precise" than a. (a copy of b is "extended" to the precision of a)
-
If result.to == SECOND, then result.fracsec is a.fracsec
-
result will have the following from/to based on a.to: result a.to from to YEAR YEAR YEAR MONTH YEAR MONTH DAY DAY DAY HOUR DAY HOUR MINUTE DAY MINUTE SECOND DAY SECOND [LAYOUT ??? - see HTML]
-
If either 'a' or 'b' has a timezone, both must have a timezone. The difference will account for the differences in the time zones.
- Parameters
-
- Returns
- int
Definition at line 79 of file diff.c.
Referenced by datetime_get_local_timezone().