_registry = $registry; } /** * Change timezone of times provided. * * @param array $input List of time entries to convert. * @param string $source_tz Timezone to convert from. * @param string $target_tz Timezone to convert to. * @param string $format Format of target time entries. * * @return array List of converted times. */ public function change_timezone( array $input, $source_tz, $target_tz = 'UTC', $format = 'U' ) { $output = array(); foreach ( $input as $time ) { try { $time_object = $this->_registry->get( 'date.time', $input, $source_tz ); $output[] = $time_object->format( $format, $target_tz ); unset( $time_object ); } catch ( Ai1ec_Date_Exception $exception ) { // ignore } } return $output; } }