Logo Search packages:      
Sourcecode: libical version File versions  Download package

struct icaltimetype icaltime_convert_to_zone ( const struct icaltimetype  tt,
icaltimezone *  zone 
) [read]

Convert time to a given timezone.

convert tt, of timezone tzid, into a utc time. Does nothing if the time is already UTC.

Convert a time from its native timezone to a given timezone.

If tt is a date, the returned time is an exact copy of the input. If it's a floating time, the returned object represents the same time translated to the given timezone. Otherwise the time will be converted to the new time zone, and its native timezone set to the right timezone.

Definition at line 1046 of file icaltime.c.

References icaltimezone_convert_time(), and icaltimezone_get_utc_timezone().

                          {

      struct icaltimetype ret = tt;

      /* If it's a date do nothing */
      if (tt.is_date) {
            return ret;
      }

      if (tt.zone == zone) {
            return ret;
      }

      /* If it's a floating time we don't want to adjust the time */
      if (tt.zone != NULL) {
            icaltimezone_convert_time(&ret, (icaltimezone *)tt.zone, zone);
      }

      ret.zone = zone;
      if (zone == icaltimezone_get_utc_timezone()) {
            ret.is_utc = 1;
      } else {
            ret.is_utc = 0;
      }

      return ret;
}


Generated by  Doxygen 1.6.0   Back to index