You are here

function _addtocalendar_convert_to_local_time in Add To Calendar Button (AddEvent.com) 7.2

Display time as per timezone.

1 call to _addtocalendar_convert_to_local_time()
addtocalendar_preprocess_setting_fields in includes/addtocalendar.inc
Process setting form fields.

File

./addtocalendar.module, line 102
Contains module code.

Code

function _addtocalendar_convert_to_local_time($date, $timezone) {
  $datetime = new DateTime($date, new DateTimeZone('UTC'));
  $datetime
    ->setTimezone(new DateTimeZone($timezone));
  return $datetime
    ->format('Y-m-d H:i:s');
}