Index: event_timezones.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/event/event_timezones.inc,v retrieving revision 1.4.2.3 diff -u -u -F^function -r1.4.2.3 event_timezones.inc --- event_timezones.inc 22 May 2006 13:35:07 -0000 1.4.2.3 +++ event_timezones.inc 28 Aug 2006 05:34:44 -0000 @@ -189,6 +189,28 @@ function event_zonelist() { return $zones; } +/** + * Get a DST-adjusted timezone adjustment for a given timezone offset and timestamp. If + * there is no known zone or no offset, will just return the value of + * $original_offset. + * @param $original_offset The original, unadjusted timezone offset. Must be one + * of the offsets valid for event_timezone_map() function, and the map used + * therein. + * @param $the_timestamp The timestamp of the event - this is used to + * determine whether the offset needs to be adjusted for DST. + * @return + */ + +function event_get_dst_adjusted_offset($original_offset, $the_timestamp) { + $zid = event_timezone_map($original_offset); + if ($zid) { + return event_get_offset($zid, $the_timestamp); + } else { + watchdog('event', "Unable to find timezone for offset $original_offset - is site timezone setting valid? "); + return $original_offset; + } +} + function event_get_offset($zid, $timestamp) { $zones = event_get_timezones(); $zone = $zones[$zid];