Fix up timezone stuff
This commit is contained in:
@@ -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', '<pre>Date-time Conversion: @info </pre>', array('@info' => print_r( $ts, true)));
|
||||
return $ts->format("U");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user