GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
#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. More... | |
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. More... | |
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. More... | |
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 More... | |
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 More... | |
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 More... | |
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 More... | |
int | datetime_get_year (const DateTime *dt, int *year) |
returns 0 on success or negative value on error More... | |
int | datetime_set_year (DateTime *dt, int year) |
if dt.mode = ABSOLUTE, this also sets dt.day = 0 More... | |
int | datetime_get_month (const DateTime *dt, int *month) |
returns 0 on success or negative value on error More... | |
int | datetime_set_month (DateTime *dt, int month) |
if dt.mode = ABSOLUTE, this also sets dt.day = 0 More... | |
int | datetime_get_day (const DateTime *dt, int *day) |
returns 0 on success or negative value on error More... | |
int | datetime_set_day (DateTime *dt, int day) |
if dt.mode = ABSOLUTE, then the dt.year, dt.month: More... | |
int | datetime_get_hour (const DateTime *dt, int *hour) |
returns 0 on success or negative value on error More... | |
int | datetime_set_hour (DateTime *dt, int hour) |
returns 0 on success or negative value on error More... | |
int | datetime_get_minute (const DateTime *dt, int *minute) |
returns 0 on success or negative value on error More... | |
int | datetime_set_minute (DateTime *dt, int minute) |
returns 0 on success or negative value on error More... | |
int | datetime_get_second (const DateTime *dt, double *second) |
returns 0 on success or negative value on error More... | |
int | datetime_set_second (DateTime *dt, double second) |
returns 0 on success or negative value on error More... | |
int | datetime_get_fracsec (const DateTime *dt, int *fracsec) |
returns 0 on success or negative value on error More... | |
int | datetime_set_fracsec (DateTime *dt, int fracsec) |
returns 0 on success or negative value on error More... | |
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.
dt | |
day |
Definition at line 87 of file values.c.
Referenced by datetime_get_day(), and datetime_set_day().
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
dt | |
fracsec |
Definition at line 199 of file values.c.
Referenced by datetime_get_fracsec(), and datetime_set_fracsec().
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
dt | |
hour |
Definition at line 124 of file values.c.
Referenced by datetime_get_hour(), and datetime_set_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
dt | |
minute |
Definition at line 149 of file values.c.
Referenced by datetime_get_minute(), and datetime_set_minute().
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.
dt | |
month |
Definition at line 52 of file values.c.
Referenced by datetime_get_month(), and datetime_set_month().
int datetime_check_second | ( | const DateTime * | dt, |
double | second | ||
) |
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.
dt | |
year |
Definition at line 27 of file values.c.
Referenced by datetime_get_year(), and datetime_set_year().
int datetime_get_day | ( | const DateTime * | dt, |
int * | day | ||
) |
returns 0 on success or negative value on error
dt | |
day |
Definition at line 312 of file values.c.
References datetime_check_day(), and DateTime::day.
Referenced by datetime_format().
int datetime_get_fracsec | ( | const DateTime * | dt, |
int * | fracsec | ||
) |
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.
int datetime_get_hour | ( | const DateTime * | dt, |
int * | hour | ||
) |
returns 0 on success or negative value on error
dt | |
hour |
Definition at line 361 of file values.c.
References datetime_check_hour(), and DateTime::hour.
int datetime_get_minute | ( | const DateTime * | dt, |
int * | minute | ||
) |
returns 0 on success or negative value on error
dt | |
minute |
Definition at line 403 of file values.c.
References datetime_check_minute(), and DateTime::minute.
int datetime_get_month | ( | const DateTime * | dt, |
int * | month | ||
) |
returns 0 on success or negative value on error
dt | |
month |
Definition at line 265 of file values.c.
References datetime_check_month(), and DateTime::month.
Referenced by datetime_format().
int datetime_get_second | ( | const DateTime * | dt, |
double * | second | ||
) |
int datetime_get_year | ( | const DateTime * | dt, |
int * | year | ||
) |
returns 0 on success or negative value on error
dt | |
year |
Definition at line 218 of file values.c.
References datetime_check_year(), and DateTime::year.
int datetime_set_day | ( | DateTime * | dt, |
int | day | ||
) |
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 340 of file values.c.
References datetime_check_day(), and DateTime::day.
Referenced by datetime_get_local_time(), and datetime_get_local_timezone().
int datetime_set_fracsec | ( | DateTime * | dt, |
int | fracsec | ||
) |
returns 0 on success or negative value on error
dt | |
fracsec |
Definition at line 508 of file values.c.
References datetime_check_fracsec(), and DateTime::fracsec.
int datetime_set_hour | ( | DateTime * | dt, |
int | hour | ||
) |
returns 0 on success or negative value on error
dt | |
hour |
Definition at line 382 of file values.c.
References datetime_check_hour(), and DateTime::hour.
Referenced by datetime_get_local_time(), and datetime_get_local_timezone().
int datetime_set_minute | ( | DateTime * | dt, |
int | minute | ||
) |
returns 0 on success or negative value on error
dt | |
minute |
Definition at line 424 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().
int datetime_set_month | ( | DateTime * | dt, |
int | month | ||
) |
if dt.mode = ABSOLUTE, this also sets dt.day = 0
returns 0 on success or negative value on error
dt | |
month |
Definition at line 288 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().
int datetime_set_second | ( | DateTime * | dt, |
double | second | ||
) |
returns 0 on success or negative value on error
dt | |
second |
Definition at line 466 of file values.c.
Referenced by datetime_get_local_time(), and datetime_get_local_timezone().
int datetime_set_year | ( | DateTime * | dt, |
int | year | ||
) |
if dt.mode = ABSOLUTE, this also sets dt.day = 0
returns 0 on success or negative value on error
dt | |
year |
Definition at line 241 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().