Function

ECalutil_comp_time_to_zone

unstable since: 3.58

Declaration [src]

time_t
e_cal_util_comp_time_to_zone (
  ICalComponent* icomp,
  ICalPropertyKind prop_kind,
  ICalTimezone* to_zone,
  ICalComponent* vcalendar,
  ETimezoneCache* tz_cache,
  ICalTime** out_itt
)

Description [src]

Converts the time/date property prop_kind to to_zone. When such property does not exist, or does not contain DATE nor DATE-TIME value, then the function returns -1 and no output argument is set.

The vcalendar is used to get the timezone for the property, if provided, otherwise the timezone is tried to be found in the tz_cache. If neither can get it, the iCal builtin timezones are checked. When the set timezone cannot be found, floating time is used (which can be almost always wrong).

Note: this uses i_cal_component_get_first_property(), thus it cannot be used in case any upper caller uses it too at the same time.

Available since: 3.58

Parameters

icomp

Type: None

An ICalComponent to get the property from.

The data is owned by the caller of the function.
prop_kind

Type: ICalPropertyKind

An ICalPropertyKind of the property to read.

to_zone

Type: None

An ICalTimezone to convert the time to, or NULL for UTC.

The argument can be NULL.
The data is owned by the caller of the function.
vcalendar

Type: None

An optional VCALENDAR component with timezones for the icomp, or NULL when not available.

The argument can be NULL.
The data is owned by the caller of the function.
tz_cache

Type: ETimezoneCache

An ETimezoneCache to use to read the time zones from, or NULL if not available.

The argument can be NULL.
The data is owned by the caller of the function.
out_itt

Type: None

Return location for the converted time as ICalTime, or NULL when not requested.

The argument will be set by the function.
The argument can be NULL.
The caller of the function takes ownership of the returned data, and is responsible for freeing it.

Return value

Type: time_t

Property’s time converted into to_zone, or -1, when the conversion was not possible.