|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-5f4f7ad06c
|

Go to the source code of this file.
Functions | |
| int | datetime_is_between (int x, int a, int b) |
| 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 they are not legal, then the original values are preserved, dt is not changed). Returns: 0 OK -1 invalid 'dt' -2 invalid 'from/to' | |
| void | datetime_copy (DateTime *src, const DateTime *dst) |
| Copies the DateTime [into/from ???] src. | |
| int | datetime_difference (const DateTime *a, const DateTime *b, DateTime *result) |
| This performs the formula: result = a - b;. | |
| 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 msg=NULL) returns 'code' so that it can be used like: | |
| int | datetime_error_code (void) |
| returns an error code | |
| char * | datetime_error_msg (void) |
| returns an error message | |
| void | datetime_clear_error (void) |
| clears error code and message | |
| int | datetime_format (const DateTime *dt, char *buf) |
| formats DateTime structure as a human-readable string returns 0 when successful and 'buf' is filled with the string returns a negative number on error | |
| 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 'src' can be anything. The mode of the 'incr' must be RELATIVE, and the type (mode/from/to) for 'incr' must be a valid increment for 'src'. See datetime_is_valid_increment(), datetime_check_increment() Returns: 0: OK -1: 'incr' is invalid increment for 'src' For src.mode ABSOLUTE,. | |
| int | datetime_is_valid_increment (const DateTime *src, const DateTime *incr) |
| Returns: datetime_check_increment(src, incr) == 0. | |
| int | datetime_check_increment (const DateTime *src, const DateTime *incr) |
| This checks if the type of 'incr' is valid for incrementing/decrementing 'src'. The type (mode/from/to) of the 'src' can be anything. The incr.mode must be RELATIVE A timezone in 'src' is allowed - it's presence is ignored. To aid in setting the 'incr' type, see datetime_get_increment_type(). Returns: | |
| int | datetime_get_increment_type (const DateTime *dt, int *mode, int *from, int *to, int *fracsec) |
| This returns the components of a type (mode/from/to/fracsec) that can be used to construct a DateTime object that can be used to increment the 'src'. Also see datetime_set_increment_type(). returns: 0 dt is legal !=0 why dt is illegal Implemented as follows: | |
| 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 | datetime_get_local_timezone (int *minutes) |
| Returns: 0 OK -1 local timezone info not available. | |
| 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_days_in_month (int year, int month, int ad) |
| returns number of days in 'month' of a particular 'year' | |
| int | datetime_is_leap_year (int year, int ad) |
| int | datetime_days_in_year (int year, int ad) |
| returns the number of days in 'year' | |
| int | datetime_is_same (const DateTime *src, const DateTime *dst) |
| Returns: 1 if 'src' is exactly the same as 'dst' 0 if they differ. | |
| int | datetime_scan (DateTime *dt, const char *buf) |
| Convert the ascii string into a DateTime. This determines the mode/from/to based on the string, inits 'dt' and then sets values in 'dt' based on the [???] Returns 0 if 'string' is legal, -1 if not. | |
| int | datetime_is_positive (const DateTime *dt) |
| Returns: 1 if the Datetime is positive 0 otherwise. | |
| int | datetime_is_negative (const DateTime *dt) |
| Returns: 1 if the DateTime is negative 0 otherwise. | |
| void | datetime_set_positive (DateTime *dt) |
| Makes the DateTime positive. (A.D. for ABSOLUTE DateTimes) | |
| void | datetime_set_negative (DateTime *dt) |
| Makes the DateTime negative. (B.C. for ABSOLUTE DateTimes) | |
| void | datetime_invert_sign (DateTime *dt) |
| int | datetime_set_type (DateTime *dt, int mode, int from, int to, int fracsec) |
| int | datetime_get_type (const DateTime *dt, int *mode, int *from, int *to, int *fracsec) |
| int | datetime_is_valid_type (const DateTime *dt) |
| Returns: 1 if datetime_check_type() returns 0 0 if not. | |
| int | datetime_check_type (const DateTime *dt) |
| checks the mode/from/to/fracsec in dt. Returns: | |
| int | datetime_in_interval_year_month (int x) |
| int | datetime_in_interval_day_second (int x) |
| 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_relative (const DateTime *dt) |
| Returns: 1 if dt.mode is relative 0 if not (even if dt.mode is not defined) | |
| int | datetime_check_timezone (const DateTime *dt, int minutes) |
| returns 0 on success | |
| int | datetime_get_timezone (const DateTime *dt, int *minutes) |
| returns 0 on success | |
| int | datetime_set_timezone (DateTime *dt, int minutes) |
| returns 0 on success | |
| int | datetime_unset_timezone (DateTime *dt) |
| unsets timezone in 'dt' returns 0 | |
| int | datetime_is_valid_timezone (int minutes) |
| Returns: 1 OK: -720 <= minutes <= 780 (720 = 12 hours; 780 = 13 hours) 0 NOT OK. | |
| int | datetime_change_timezone (DateTime *dt, int minutes) |
| if dt has a timezone, increment dt by minutes-dt.tz MINUTES and set dt.tz = minutes Returns: 0 OK datetime_check_timezone (dt) if not -4 if minutes invalid | |
| int | datetime_change_to_utc (DateTime *dt) |
| Return datetime_change_timezone (dt, 0);. | |
| void | datetime_decompose_timezone (int tz, int *hours, int *minutes) |
| tz = abs(tz) *hour = tz/60 *minute = tz%60 Note: hour,minute are non-negative. Must look at sign of tz itself to see if the tz is negative offset or not. This routine would be used to format tz for output. For example if tz=-350 this would be hour=5 minute=50, but negative. Output might encode this as -0550: printf ("%s%02d%02d", tz<0?"-":"", hour, minute) | |
| int | datetime_check_year (const DateTime *dt, int year) |
| Returns: 0 is legal year for dt -1 illegal year for this dt -2 dt has no year component. | |
| int | datetime_check_month (const DateTime *dt, int month) |
| Returns: 0 is legal month for dt -1 illegal month for this dt -2 dt has no month component. | |
| int | datetime_check_day (const DateTime *dt, int day) |
| Returns: 0 is legal day for dt -1 illegal day for this dt -2 dt has no day component Note: if dt.mode is ABSOLUTE, then dt.year and dt.month must also be legal, since the 'day' must be a legal value for the dt.year/dt.month. | |
| int | datetime_check_hour (const DateTime *dt, int hour) |
| returns: 0 on success -1 if 'dt' has an invalid hour -2 if 'dt' has no hour | |
| int | datetime_check_minute (const DateTime *dt, int minute) |
| returns: 0 on success -1 if 'dt' has an invalid minute -2 if 'dt' has no minute | |
| int | datetime_check_second (const DateTime *dt, double second) |
| returns: 0 on success -1 if 'dt' has an invalid second -2 if 'dt' has no second | |
| int | datetime_check_fracsec (const DateTime *dt, int fracsec) |
| returns: 0 on success -1 if 'dt' has an invalid fracsec -2 if 'dt' has no fracsec | |
| int | datetime_get_year (const DateTime *dt, int *year) |
| 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_get_month (const DateTime *dt, int *month) |
| returns 0 on success or negative value on error | |
| int | datetime_set_month (DateTime *dt, int month) |
| if dt.mode = ABSOLUTE, this also sets dt.day = 0 | |
| int | datetime_get_day (const DateTime *dt, int *day) |
| 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_get_hour (const DateTime *dt, int *hour) |
| returns 0 on success or negative value on error | |
| int | datetime_set_hour (DateTime *dt, int hour) |
| returns 0 on success or negative value on error | |
| int | datetime_get_minute (const DateTime *dt, int *minute) |
| 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_get_second (const DateTime *dt, double *second) |
| returns 0 on success or negative value on error | |
| int | datetime_set_second (DateTime *dt, double second) |
| returns 0 on success or negative value on error | |
| int | datetime_get_fracsec (const DateTime *dt, int *fracsec) |
| returns 0 on success or negative value on error | |
| int | datetime_set_fracsec (DateTime *dt, int fracsec) |
| returns 0 on success or negative value on error | |
Changes the from/to of the type for dt. The 'from/to' must be legal values for the mode of dt; (if they are not legal, then the original values are preserved, dt is not changed). Returns: 0 OK -1 invalid 'dt' -2 invalid 'from/to'
| dt | |
| from | |
| to | |
| round |
Definition at line 53 of file change.c.
References DATETIME_DAY, datetime_days_in_year(), DATETIME_HOUR, datetime_increment(), datetime_is_absolute(), datetime_is_valid_type(), DATETIME_MINUTE, DATETIME_MONTH, DATETIME_SECOND, datetime_set_type(), DATETIME_YEAR, DateTime::day, DateTime::fracsec, DateTime::from, DateTime::hour, DateTime::minute, DateTime::mode, DateTime::month, DateTime::positive, DateTime::second, DateTime::to, x, and DateTime::year.
Referenced by datetime_difference(), datetime_get_local_timezone(), and datetime_increment().
if dt has a timezone, increment dt by minutes-dt.tz MINUTES and set dt.tz = minutes Returns: 0 OK datetime_check_timezone (dt) if not -4 if minutes invalid
| dt | |
| minutes |
Definition at line 20 of file tz2.c.
References datetime_error(), datetime_get_timezone(), datetime_increment(), datetime_invert_sign(), datetime_is_valid_timezone(), DATETIME_MINUTE, DATETIME_RELATIVE, datetime_set_minute(), and datetime_set_type().
Referenced by datetime_change_to_utc().
Return datetime_change_timezone (dt, 0);.
| dt |
Definition at line 57 of file tz2.c.
References datetime_change_timezone().
Referenced by datetime_difference().
Returns: 0 is legal day for dt -1 illegal day for this dt -2 dt has no day component
Note: if dt.mode is ABSOLUTE, then dt.year and dt.month must also be legal, since the 'day' must be a legal value for the dt.year/dt.month.
| dt | |
| day |
Definition at line 84 of file values.c.
References DATETIME_DAY, datetime_days_in_month(), datetime_error(), datetime_get_month(), datetime_get_year(), datetime_is_absolute(), and datetime_is_positive().
Referenced by datetime_get_day(), and datetime_set_day().
returns: 0 on success -1 if 'dt' has an invalid fracsec -2 if 'dt' has no fracsec
| dt | |
| fracsec |
Definition at line 192 of file values.c.
References datetime_error(), and DATETIME_SECOND.
Referenced by datetime_get_fracsec(), and datetime_set_fracsec().
returns: 0 on success -1 if 'dt' has an invalid hour -2 if 'dt' has no hour
| dt | |
| hour |
Definition at line 120 of file values.c.
References datetime_error(), DATETIME_HOUR, and DateTime::from.
Referenced by datetime_get_hour(), and datetime_set_hour().
This checks if the type of 'incr' is valid for incrementing/decrementing 'src'. The type (mode/from/to) of the 'src' can be anything. The incr.mode must be RELATIVE A timezone in 'src' is allowed - it's presence is ignored. To aid in setting the 'incr' type, see datetime_get_increment_type(). Returns:
| src | |
| incr |
Definition at line 56 of file incr2.c.
References datetime_error(), datetime_in_interval_day_second(), datetime_in_interval_year_month(), datetime_is_relative(), datetime_is_valid_type(), and DateTime::to.
Referenced by datetime_is_valid_increment().
returns: 0 on success -1 if 'dt' has an invalid minute -2 if 'dt' has no minute
| dt | |
| minute |
Definition at line 144 of file values.c.
References datetime_error(), DATETIME_MINUTE, and DateTime::from.
Referenced by datetime_get_minute(), and datetime_set_minute().
Returns: 0 is legal month for dt -1 illegal month for this dt -2 dt has no month component.
| dt | |
| month |
Definition at line 50 of file values.c.
References datetime_error(), datetime_is_absolute(), datetime_is_relative(), DATETIME_MONTH, and DateTime::from.
Referenced by datetime_get_month(), and datetime_set_month().
returns: 0 on success -1 if 'dt' has an invalid second -2 if 'dt' has no second
| dt | |
| second |
Definition at line 168 of file values.c.
References datetime_error(), DATETIME_SECOND, and DateTime::from.
Referenced by datetime_get_second(), and datetime_set_second().
returns 0 on success
| dt | |
| minutes |
Definition at line 23 of file tz1.c.
References datetime_error(), datetime_is_absolute(), datetime_is_valid_timezone(), and DATETIME_MINUTE.
Referenced by datetime_get_timezone(), and datetime_set_timezone().
checks the mode/from/to/fracsec in dt. Returns:
| dt |
Definition at line 110 of file datetime/type.c.
References DATETIME_ABSOLUTE, datetime_error(), datetime_in_interval_day_second(), datetime_in_interval_year_month(), datetime_is_between(), DATETIME_RELATIVE, DATETIME_SECOND, DATETIME_YEAR, DateTime::fracsec, DateTime::from, DateTime::mode, and DateTime::to.
Referenced by datetime_get_type(), datetime_is_valid_type(), and datetime_set_type().
Returns: 0 is legal year for dt -1 illegal year for this dt -2 dt has no year component.
| dt | |
| year |
Definition at line 26 of file values.c.
References datetime_error(), datetime_is_absolute(), and DATETIME_YEAR.
Referenced by datetime_get_year(), and datetime_set_year().
Copies the DateTime [into/from ???] src.
| dst | |
| src |
Definition at line 19 of file datetime/copy.c.
Referenced by datetime_difference(), datetime_increment(), G_get_timestamps(), G_set_timestamp(), and G_set_timestamp_range().
returns number of days in 'month' of a particular 'year'
| month | |
| year | |
| ad |
Definition at line 58 of file datetime/misc.c.
References datetime_error(), and datetime_is_leap_year().
Referenced by datetime_check_day().
returns the number of days in 'year'
| year | |
| ad |
Definition at line 37 of file datetime/misc.c.
References datetime_error(), and datetime_is_leap_year().
Referenced by datetime_change_from_to().
tz = abs(tz) *hour = tz/60 *minute = tz%60 Note: hour,minute are non-negative. Must look at sign of tz itself to see if the tz is negative offset or not. This routine would be used to format tz for output. For example if tz=-350 this would be hour=5 minute=50, but negative. Output might encode this as -0550: printf ("%s%02d%02d", tz<0?"-":"", hour, minute)
| tz | |
| hours | |
| minutes |
Definition at line 79 of file tz2.c.
Referenced by datetime_format().
This performs the formula: result = a - b;.
| a | |
| b | |
| result |
Definition at line 78 of file diff.c.
References b, compare(), datetime_change_from_to(), datetime_change_to_utc(), datetime_copy(), DATETIME_DAY, datetime_error(), datetime_get_timezone(), datetime_in_interval_year_month(), datetime_increment(), datetime_invert_sign(), DATETIME_RELATIVE, datetime_set_increment_type(), datetime_set_type(), DATETIME_YEAR, DateTime::day, DateTime::fracsec, DateTime::hour, DateTime::minute, DateTime::month, DateTime::positive, DateTime::second, DateTime::to, and DateTime::year.
Referenced by datetime_get_local_timezone().
record 'code' and 'msg' as error code/msg (in static variables) code==0 will clear the error (ie set msg=NULL) returns 'code' so that it can be used like:
| code | |
| msg |
Definition at line 27 of file datetime/error.c.
References strcpy.
Referenced by datetime_change_timezone(), datetime_check_day(), datetime_check_fracsec(), datetime_check_hour(), datetime_check_increment(), datetime_check_minute(), datetime_check_month(), datetime_check_second(), datetime_check_timezone(), datetime_check_type(), datetime_check_year(), datetime_days_in_month(), datetime_days_in_year(), datetime_difference(), datetime_is_leap_year(), and datetime_scan().
returns an error code
Definition at line 44 of file datetime/error.c.
Referenced by datetime_format(), datetime_get_increment_type(), datetime_increment(), and datetime_set_increment_type().
formats DateTime structure as a human-readable string returns 0 when successful and 'buf' is filled with the string returns a negative number on error
| dt | |
| buf |
Definition at line 25 of file datetime/format.c.
References datetime_decompose_timezone(), datetime_error_code(), datetime_get_day(), datetime_get_fracsec(), datetime_get_hour(), datetime_get_minute(), datetime_get_month(), datetime_get_second(), datetime_get_timezone(), datetime_get_year(), datetime_is_absolute(), datetime_is_negative(), datetime_is_relative(), and datetime_is_valid_type().
Referenced by G_format_timestamp().
returns 0 on success or negative value on error
| dt | |
| day |
Definition at line 300 of file values.c.
References datetime_check_day(), and DateTime::day.
Referenced by datetime_format().
returns 0 on success or negative value on error
| dt | |
| fracsec |
Definition at line 467 of file values.c.
References datetime_check_fracsec(), and DateTime::fracsec.
Referenced by datetime_format().
returns 0 on success or negative value on error
| dt | |
| hour |
Definition at line 347 of file values.c.
References datetime_check_hour(), and DateTime::hour.
Referenced by datetime_format().
| int datetime_get_increment_type | ( | const DateTime * | dt, |
| int * | mode, | ||
| int * | from, | ||
| int * | to, | ||
| int * | fracsec | ||
| ) |
This returns the components of a type (mode/from/to/fracsec) that can be used to construct a DateTime object that can be used to increment the 'src'. Also see datetime_set_increment_type(). returns: 0 dt is legal !=0 why dt is illegal Implemented as follows:
| dt | |
| mode | |
| from | |
| to | |
| fracsec |
Definition at line 40 of file incr3.c.
References DATETIME_DAY, datetime_error_code(), datetime_in_interval_year_month(), datetime_is_absolute(), datetime_is_valid_type(), DATETIME_RELATIVE, DATETIME_YEAR, DateTime::fracsec, DateTime::from, and DateTime::to.
Referenced by datetime_set_increment_type().
set mode/from/to ABSOLUTE/YEAR/SECOND set the local time into 'dt' does not set timezone.
| dt |
Definition at line 80 of file local.c.
References AMI_STREAM< T >::AMI_STREAM(), DATETIME_ABSOLUTE, DATETIME_SECOND, datetime_set_day(), datetime_set_hour(), datetime_set_minute(), datetime_set_month(), datetime_set_second(), datetime_set_type(), datetime_set_year(), and DATETIME_YEAR.
Returns: 0 OK -1 local timezone info not available.
| minutes |
Definition at line 28 of file local.c.
References AMI_STREAM< T >::AMI_STREAM(), DATETIME_ABSOLUTE, datetime_change_from_to(), DATETIME_DAY, datetime_difference(), DATETIME_MINUTE, DATETIME_RELATIVE, DATETIME_SECOND, datetime_set_day(), datetime_set_hour(), datetime_set_minute(), datetime_set_month(), datetime_set_second(), datetime_set_type(), datetime_set_year(), and DATETIME_YEAR.
returns 0 on success or negative value on error
| dt | |
| minute |
Definition at line 387 of file values.c.
References datetime_check_minute(), and DateTime::minute.
Referenced by datetime_format().
returns 0 on success or negative value on error
| dt | |
| month |
Definition at line 255 of file values.c.
References datetime_check_month(), and DateTime::month.
Referenced by datetime_check_day(), and datetime_format().
returns 0 on success or negative value on error
| dt | |
| second |
Definition at line 427 of file values.c.
References datetime_check_second(), and DateTime::second.
Referenced by datetime_format().
returns 0 on success
| dt | |
| minutes |
Definition at line 44 of file tz1.c.
References datetime_check_timezone(), and DateTime::tz.
Referenced by datetime_change_timezone(), datetime_difference(), and datetime_format().
Definition at line 56 of file datetime/type.c.
References datetime_check_type(), DateTime::fracsec, DateTime::from, DateTime::mode, and DateTime::to.
returns 0 on success or negative value on error
| dt | |
| year |
Definition at line 210 of file values.c.
References datetime_check_year(), and DateTime::year.
Referenced by datetime_check_day(), and datetime_format().
Definition at line 150 of file datetime/type.c.
References DATETIME_DAY, datetime_is_between(), DATETIME_SECOND, and x.
Referenced by datetime_check_increment(), datetime_check_type(), and datetime_increment().
Definition at line 145 of file datetime/type.c.
References datetime_is_between(), DATETIME_MONTH, DATETIME_YEAR, and x.
Referenced by datetime_check_increment(), datetime_check_type(), datetime_difference(), and datetime_get_increment_type().
This function changes the 'src' date/time data based on the 'incr' The type (mode/from/to) of the 'src' can be anything. The mode of the 'incr' must be RELATIVE, and the type (mode/from/to) for 'incr' must be a valid increment for 'src'. See datetime_is_valid_increment(), datetime_check_increment() Returns: 0: OK -1: 'incr' is invalid increment for 'src' For src.mode ABSOLUTE,.
The 'fracsec' in 'src' is preserved. The 'from/to' of the 'src' is preserved. A timezone in 'src' is allowed - it's presence is ignored. NOTE: There is no datetime_decrement() To decrement, set the 'incr' negative.
| src | |
| incr |
Definition at line 67 of file incr1.c.
References datetime_change_from_to(), datetime_copy(), DATETIME_DAY, datetime_error_code(), datetime_in_interval_day_second(), datetime_is_valid_increment(), DATETIME_RELATIVE, DATETIME_YEAR, DateTime::from, DateTime::mode, DateTime::positive, and DateTime::to.
Referenced by datetime_change_from_to(), datetime_change_timezone(), and datetime_difference().
| dt |
Definition at line 71 of file sign.c.
References DateTime::positive.
Referenced by datetime_change_timezone(), and datetime_difference().
Returns: 1 if dt.mode is absolute 0 if not (even if dt.mode is not defined)
| dt |
Definition at line 165 of file datetime/type.c.
References DATETIME_ABSOLUTE, and DateTime::mode.
Referenced by datetime_change_from_to(), datetime_check_day(), datetime_check_month(), datetime_check_timezone(), datetime_check_year(), datetime_format(), datetime_get_increment_type(), datetime_set_month(), and datetime_set_year().
Definition at line 7 of file between.c.
Referenced by datetime_check_type(), datetime_in_interval_day_second(), and datetime_in_interval_year_month().
| year | |
| ad |
Definition at line 16 of file datetime/misc.c.
References datetime_error().
Referenced by datetime_days_in_month(), and datetime_days_in_year().
Returns: 1 if the DateTime is negative 0 otherwise.
| dt |
Definition at line 34 of file sign.c.
References DateTime::positive.
Referenced by datetime_format().
Returns: 1 if the Datetime is positive 0 otherwise.
| dt |
Definition at line 19 of file sign.c.
References DateTime::positive.
Referenced by datetime_check_day().
Returns: 1 if dt.mode is relative 0 if not (even if dt.mode is not defined)
| dt |
Definition at line 180 of file datetime/type.c.
References DATETIME_RELATIVE, and DateTime::mode.
Referenced by datetime_check_increment(), datetime_check_month(), and datetime_format().
Returns: datetime_check_increment(src, incr) == 0.
| src | |
| incr |
Definition at line 19 of file incr2.c.
References datetime_check_increment().
Referenced by datetime_increment().
Returns: 1 OK: -720 <= minutes <= 780 (720 = 12 hours; 780 = 13 hours) 0 NOT OK.
| minutes |
Definition at line 101 of file tz1.c.
Referenced by datetime_change_timezone(), and datetime_check_timezone().
Returns: 1 if datetime_check_type() returns 0 0 if not.
| dt |
Definition at line 76 of file datetime/type.c.
References datetime_check_type().
Referenced by datetime_change_from_to(), datetime_check_increment(), datetime_format(), and datetime_get_increment_type().
Convert the ascii string into a DateTime. This determines the mode/from/to based on the string, inits 'dt' and then sets values in 'dt' based on the [???] Returns 0 if 'string' is legal, -1 if not.
| dt | |
| buf |
Definition at line 40 of file scan.c.
References datetime_error().
Referenced by G_scan_timestamp().
if dt.mode = ABSOLUTE, then the dt.year, dt.month:
This implies that year/month must be set for ABSOLUTE datetimes.
Returns 0 on success or negative value on error
| dt | |
| day |
Definition at line 327 of file values.c.
References datetime_check_day(), and DateTime::day.
Referenced by datetime_get_local_time(), and datetime_get_local_timezone().
returns 0 on success or negative value on error
| dt | |
| fracsec |
Definition at line 487 of file values.c.
References datetime_check_fracsec(), and DateTime::fracsec.
returns 0 on success or negative value on error
| dt | |
| hour |
Definition at line 367 of file values.c.
References datetime_check_hour(), and DateTime::hour.
Referenced by datetime_get_local_time(), and datetime_get_local_timezone().
src must be legal This is a convenience routine which is implemented as follows:
Timezone Timezones are represented in minutes from GMT in the range [-720,+780]. For a DateTime to have a timezone, it must be of type ABSOLUTE, and "to" must be in {MINUTE,SECOND}.
| src | |
| incr |
Definition at line 82 of file incr3.c.
References datetime_error_code(), datetime_get_increment_type(), and datetime_set_type().
Referenced by datetime_difference().
returns 0 on success or negative value on error
| dt | |
| minute |
Definition at line 407 of file values.c.
References datetime_check_minute(), and DateTime::minute.
Referenced by datetime_change_timezone(), datetime_get_local_time(), and datetime_get_local_timezone().
if dt.mode = ABSOLUTE, this also sets dt.day = 0
returns 0 on success or negative value on error
| dt | |
| month |
Definition at line 277 of file values.c.
References datetime_check_month(), datetime_is_absolute(), DateTime::day, and DateTime::month.
Referenced by datetime_get_local_time(), and datetime_get_local_timezone().
Makes the DateTime negative. (B.C. for ABSOLUTE DateTimes)
| dt |
Definition at line 60 of file sign.c.
References DateTime::positive.
Makes the DateTime positive. (A.D. for ABSOLUTE DateTimes)
| dt |
Definition at line 47 of file sign.c.
References DateTime::positive.
returns 0 on success or negative value on error
| dt | |
| second |
Definition at line 447 of file values.c.
References datetime_check_second(), and DateTime::second.
Referenced by datetime_get_local_time(), and datetime_get_local_timezone().
returns 0 on success
| dt | |
| minutes |
Definition at line 64 of file tz1.c.
References datetime_check_timezone(), and DateTime::tz.
datetime_check_type(dt) | dt | |
| mode | |
| from | |
| to | |
| fracsec |
Definition at line 36 of file datetime/type.c.
References datetime_check_type(), datetime_unset_timezone(), DateTime::day, DateTime::fracsec, DateTime::from, DateTime::hour, DateTime::minute, DateTime::mode, DateTime::month, DateTime::positive, DateTime::second, DateTime::to, and DateTime::year.
Referenced by datetime_change_from_to(), datetime_change_timezone(), datetime_difference(), datetime_get_local_time(), datetime_get_local_timezone(), and datetime_set_increment_type().
if dt.mode = ABSOLUTE, this also sets dt.day = 0
returns 0 on success or negative value on error
| dt | |
| year |
Definition at line 232 of file values.c.
References datetime_check_year(), datetime_is_absolute(), DateTime::day, and DateTime::year.
Referenced by datetime_get_local_time(), and datetime_get_local_timezone().
unsets timezone in 'dt' returns 0
| dt |
Definition at line 84 of file tz1.c.
References DateTime::tz.
Referenced by datetime_set_type().