Loading...
Searching...
No Matches
incr3.c File Reference
`#include <grass/datetime.h>`
Include dependency graph for incr3.c:

Go to the source code of this file.

## Functions

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:

## Function Documentation

## datetime_get_increment_type()

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:

*mode = RELATIVE
*to = src.to
*fracsec = src.fracsec
if src.mode is ABSOLUTE
if src.to is in {YEAR,MONTH} then
*from = YEAR
if src.to is in {DAY,HOUR,MINUTE,SECOND} then
*from = DAY
if src.mode is RELATIVE, then
*from = src.from

Parameters

  dt |
  mode |
  from |
  to |
  fracsec |

Returns
  int

Definition at line 40 of file incr3.c.

References datetime_error_code(), datetime_in_interval_year_month(), datetime_is_absolute(), and datetime_is_valid_type().

Referenced by datetime_set_increment_type().

## datetime_set_increment_type()

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 mode, from ,to;
int fracsec;
if(<b>datetime_get_increment_type</b>(src, &mode, &from, &to, &fracsec))
return <b>datetime_get_error_code()</b>;
return <b>datetime_set_type</b> (incr, mode, from, to, fracsec);
b
double b
Definition driver/set_window.c:5
datetime_get_increment_type
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...
Definition incr3.c:40
datetime_set_type
int datetime_set_type(DateTime *dt, int mode, int from, int to, int fracsec)
Definition type.c:36

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

Parameters

  src |
  incr |

Returns
  int

Definition at line 82 of file incr3.c.

References datetime_error_code(), datetime_get_increment_type(), and datetime_set_type().

Referenced by datetime_difference().