From 08a329417d9627e7efcfc6a564e489fa393378bb Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Mon, 1 Dec 2014 23:32:00 +1100 Subject: [PATCH] Fix up timezone stuff --- booking.events.inc | 4 ++-- booking.helper.inc | 7 ++++--- booking.module | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/booking.events.inc b/booking.events.inc index d067322..23e6aff 100644 --- a/booking.events.inc +++ b/booking.events.inc @@ -222,8 +222,8 @@ function booking_event_form_submit($form, &$form_state) { global $event; $values = $form_state['input']; - date_default_timezone_set(TIMEZONE); - $tz = new DateTimeZone(TIMEZONE); + //date_default_timezone_set(date_default_timezone(FALSE)); + //$tz = new DateTimeZone(date_default_timezone(FALSE)); //watchdog('booking', 'Checkboxes when setting buttons: @info', array ('@info' => var_export($checkboxes, TRUE))); diff --git a/booking.helper.inc b/booking.helper.inc index 0eebcbe..ee35b5a 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -188,18 +188,19 @@ function _datearray_to_ts($date) function _datetime_array_to_ts($date) { //watchdog('booking', 'Date-time Conversion: @info', array('@info' => var_export($date, TRUE))); + //watchdog('booking', "Date time conversion timezone configured as: @info", array('@info' => date_default_timezone(FALSE))); date_default_timezone_set(date_default_timezone(FALSE)); $tz = new DateTimeZone(date_default_timezone(FALSE)); if (empty($date) || ($date['month'] == '' && $date['day'] == '' && $date['year'] == '')) return 0; - else - watchdog('booking', "Date array to timestamp: @info", array('@info' => var_export($date, TRUE))); + //else + // watchdog('booking', "Date array to timestamp: @info", array('@info' => var_export($date, TRUE))); $gmt_ts = mktime($date['hour'], $date['minute'], 0, $date['month'], $date['day'], $date['year']); $ts = new DateTime("@$gmt_ts"); $ts->setTimezone($tz); - + //watchdog('booking', '
Date-time Conversion: @info 
', array('@info' => print_r( $ts, true))); return $ts->format("U"); } diff --git a/booking.module b/booking.module index ab4a7c5..ae03ea8 100644 --- a/booking.module +++ b/booking.module @@ -19,7 +19,7 @@ define('EVENTID', 1); define('BOOKING_PAYPAL_SUBMIT_URL', 'https://www.paypal.com/cgi-bin/webscr'); define('BOOKING_PAYPAL_SUBMIT_URL_SANDBOX', 'https://www.sandbox.paypal.com/cgi-bin/webscr'); define('BOOKING_PAYPAL_IPN_PATH', 'system/booking_paypal/ipn'); -define('date_default_timezone(FALSE)', 'Australia/Sydney'); +//define('TIMEZONE', 'Australia/Sydney'); define('BOOKING_DEFAULT_STATE', 'NSW'); //define('CUSTOM_EMAIL_COUNT', 10); //define('STUDYGROUP_COUNT', 7);