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_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 More... | |
int | datetime_change_to_utc (DateTime *dt) |
Return datetime_change_timezone (dt, 0);. More... | |
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) More... | |
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
dt | |
minutes |
Definition at line 21 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().
int datetime_change_to_utc | ( | DateTime * | dt | ) |
Return datetime_change_timezone (dt, 0);.
dt |
Definition at line 59 of file tz2.c.
References datetime_change_timezone().
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)
tz | |
hours | |
minutes |