GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tz2.c File Reference
#include <grass/datetime.h>
Include dependency graph for tz2.c:

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...
 

Function Documentation

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

Parameters
dt
minutes
Returns
int

Definition at line 24 of file tz2.c.

References datetime_error(), datetime_get_timezone(), datetime_increment(), datetime_invert_sign(), datetime_is_valid_timezone(), datetime_set_minute(), datetime_set_type(), and stat.

Referenced by datetime_change_to_utc().

int datetime_change_to_utc ( DateTime *  dt)

Return datetime_change_timezone (dt, 0);.

Parameters
dt
Returns
int

Definition at line 63 of file tz2.c.

References datetime_change_timezone().

Referenced by datetime_difference().

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)

Parameters
tz
hours
minutes
Returns
void

Definition at line 87 of file tz2.c.

Referenced by datetime_format().