|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-5f4f7ad06c
|
#include <grass/datetime.h>
Go to the source code of this file.
Functions | |
| 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 | |
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().
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 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().
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().
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 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().
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().
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().
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().
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().