} ```
```
There are several ways to create a new icaltimetype:
- icaltime_null_time()
- icaltime_null_date()
- icaltime_current_time_with_zone()
- icaltime_today()
- icaltime_from_timet_with_zone(time_t tm, int is_date,
icaltimezone *zone)
- icaltime_from_day_of_year(int doy, int year)
italtimetype objects can be converted to different formats:
- icaltime_as_timet(struct icaltimetype tt)
- icaltime_as_timet_with_zone(struct icaltimetype tt,
icaltimezone *zone)
- icaltime_as_ical_string(struct icaltimetype tt)
Accessor methods include:
- icaltime_get_timezone(struct icaltimetype t)
- icaltime_get_tzid(struct icaltimetype t)
- icaltime_set_timezone(struct icaltimetype t, const icaltimezone *zone)
- icaltime_day_of_year(struct icaltimetype t)
- icaltime_day_of_week(struct icaltimetype t)
- icaltime_start_doy_week(struct icaltimetype t, int fdow)
- icaltime_week_number(struct icaltimetype t)
Query methods include:
- icaltime_is_null_time(struct icaltimetype t)
- icaltime_is_valid_time(struct icaltimetype t)
- icaltime_is_date(struct icaltimetype t)
- icaltime_is_utc(struct icaltimetype t)
Modify, compare and utility methods include:
- icaltime_compare(struct icaltimetype a,struct icaltimetype b)
- icaltime_compare_date_only(struct icaltimetype a,
struct icaltimetype b)
- icaltime_adjust(struct icaltimetype *tt, int days, int hours,
int minutes, int seconds);
- icaltime_normalize(struct icaltimetype t);
- icaltime_convert_to_zone(const struct icaltimetype tt,
icaltimezone *zone);
is the same as that used by icaldurationtype_from_string().
```c // create icalperiodtype const char *period_string = "20170606T090000/20170607T090000"; struct icalperiodtype period = icalperiodtype_from_string(period_string);
// print period in iCal format printf("%s\n", icalperiodtype_as_ical_string(period)); ```
} ```