## e-cal-time-util e-cal-time-util — |

## Synopsis

    int         time_days_in_month              (int year,
                                                 int month);
    int         time_day_of_year                (int day,
                                                 int month,
                                                 int year);
    int         time_day_of_week                (int day,
                                                 int month,
                                                 int year);
    gboolean    time_is_leap_year               (int year);
    int         time_leap_years_up_to           (int year);
    char*       isodate_from_time_t             (time_t t);
    time_t      time_from_isodate               (const char *str);
    time_t      time_add_day                    (time_t time,
                                                 int days);
    time_t      time_add_week                   (time_t time,
                                                 int weeks);
    time_t      time_day_begin                  (time_t t);
    time_t      time_day_end                    (time_t t);
    time_t      time_add_day_with_zone          (time_t time,
                                                 int days,
                                                 icaltimezone *zone);
    time_t      time_add_week_with_zone         (time_t time,
                                                 int weeks,
                                                 icaltimezone *zone);
    time_t      time_add_month_with_zone        (time_t time,
                                                 int months,
                                                 icaltimezone *zone);
    time_t      time_year_begin_with_zone       (time_t time,
                                                 icaltimezone *zone);
    time_t      time_month_begin_with_zone      (time_t time,
                                                 icaltimezone *zone);
    time_t      time_week_begin_with_zone       (time_t time,
                                                 int week_start_day,
                                                 icaltimezone *zone);
    time_t      time_day_begin_with_zone        (time_t time,
                                                 icaltimezone *zone);
    time_t      time_day_end_with_zone          (time_t time,
                                                 icaltimezone *zone);
    void        time_to_gdate_with_zone         (GDate *date,
                                                 time_t time,
                                                 icaltimezone *zone);

## Description

## Details

### time_days_in_month ()

    int         time_days_in_month              (int year,
                                                 int month);

`year` : |
`month` : |
Returns : |

### time_day_of_year ()

    int         time_day_of_year                (int day,
                                                 int month,
                                                 int year);

`day` : |
`month` : |
`year` : |
Returns : |

### time_day_of_week ()

    int         time_day_of_week                (int day,
                                                 int month,
                                                 int year);

`day` : |
`month` : |
`year` : |
Returns : |

### time_is_leap_year ()

    gboolean    time_is_leap_year               (int year);

`year` : |
Returns : |

### time_leap_years_up_to ()

    int         time_leap_years_up_to           (int year);

`year` : |
Returns : |

### isodate_from_time_t ()

    char*       isodate_from_time_t             (time_t t);

Creates an ISO 8601 UTC representation from a time value.

`t` : | A time value.
Returns : | String with the ISO 8601 representation of the UTC time.

### time_from_isodate ()

    time_t      time_from_isodate               (const char *str);

Converts an ISO 8601 UTC time string into a time_t value.

`str` : | Date/time value in ISO 8601 format.
Returns : | Time_t corresponding to the specified ISO string. Note that we only allow UTC times at present.

### time_add_day ()

    time_t      time_add_day                    (time_t time,
                                                 int days);

`time` : |
`days` : |
Returns : |

### time_add_week ()

    time_t      time_add_week                   (time_t time,
                                                 int weeks);

`time` : |
`weeks` : |
Returns : |

### time_day_begin ()

    time_t      time_day_begin                  (time_t t);

`t` : |
Returns : |

### time_day_end ()

    time_t      time_day_end                    (time_t t);

`t` : |
Returns : |

### time_add_day_with_zone ()

    time_t      time_add_day_with_zone          (time_t time,
                                                 int days,
                                                 icaltimezone *zone);

`time` : |
`days` : |
`zone` : |
Returns : |

### time_add_week_with_zone ()

    time_t      time_add_week_with_zone         (time_t time,
                                                 int weeks,
                                                 icaltimezone *zone);

`time` : |
`weeks` : |
`zone` : |
Returns : |

### time_add_month_with_zone ()

    time_t      time_add_month_with_zone        (time_t time,
                                                 int months,
                                                 icaltimezone *zone);

`time` : |
`months` : |
`zone` : |
Returns : |

### time_year_begin_with_zone ()

    time_t      time_year_begin_with_zone       (time_t time,
                                                 icaltimezone *zone);

`time` : |
`zone` : |
Returns : |

### time_month_begin_with_zone ()

    time_t      time_month_begin_with_zone      (time_t time,
                                                 icaltimezone *zone);

`time` : |
`zone` : |
Returns : |

### time_week_begin_with_zone ()

    time_t      time_week_begin_with_zone       (time_t time,
                                                 int week_start_day,
                                                 icaltimezone *zone);

`time` : |
`week_start_day` : |
`zone` : |
Returns : |

### time_day_begin_with_zone ()

    time_t      time_day_begin_with_zone        (time_t time,
                                                 icaltimezone *zone);

`time` : |
`zone` : |
Returns : |

### time_day_end_with_zone ()

    time_t      time_day_end_with_zone          (time_t time,
                                                 icaltimezone *zone);

`time` : |
`zone` : |
Returns : |

### time_to_gdate_with_zone ()

    void        time_to_gdate_with_zone         (GDate *date,
                                                 time_t time,
                                                 icaltimezone *zone);

Converts a time_t value to a GDate structure using the specified timezone. This is analogous to `g_date_set_time()` but takes the timezone into account.

`date` : | Destination GDate value.
`time` : | A time value.
`zone` : | Desired timezone for destination `date`, or NULL if the UTC timezone is desired.