- /* Do the conversion. */
- icaltimezone_convert_time(&TheTime,
- t,
- icaltimezone_get_utc_timezone()
- );
- TheTime.is_utc = 1;
+ /* syslog(LOG_DEBUG, " * Was: %s\n", icaltime_as_ical_string(TheTime)); */
+
+ if (icaltime_is_utc(TheTime)) {
+ /* syslog(LOG_DEBUG, " * This property is ALREADY UTC.\n"); */
+ }
+
+ else if (utc_declared_as_tzid) {
+ /* syslog(LOG_DEBUG, " * Replacing '%s' TZID with 'Z' suffix.\n", tzid); */
+ TheTime.zone = icaltimezone_get_utc_timezone();
+ }
+
+ else {
+ /* Do the conversion. */
+ if (t != NULL) {
+ /* syslog(LOG_DEBUG, " * Timezone prop found. Converting to UTC.\n"); */
+ }
+ else {
+ /* syslog(LOG_DEBUG, " * Converting default timezone to UTC.\n"); */
+ }
+
+ if (t == NULL) {
+ t = get_default_icaltimezone();
+ }
+
+ icaltimezone_convert_time(&TheTime,
+ t,
+ icaltimezone_get_utc_timezone()
+ );
+ TheTime.zone = icaltimezone_get_utc_timezone();
+ }
+