dpt321 Posted July 5, 2010 Share Posted July 5, 2010 Hi all, I have inherited a php script that I am hosting on a US server but am trying to get it to work using Australian timezones (its a booking script). BEfore you ask, changing the timezone of the server is unfortunately not an option. I have narrowed the problem code down to the below, adding the below to the top of the script date_default_timezone_set('Australia/ACT'); gets the display part working but when they submit times for booking based on the $dtDate variable, it is submitted based on server time. Any ideas? <? session_start(); date_default_timezone_set('Australia/ACT'); require 'common.php'; $dtDate = date("Y-m-d", mktime(0, 0, 0, date("m") , date("d")+$_SESSION[OFFSET], date("Y"))); ?> Quote Link to comment https://forums.phpfreaks.com/topic/206733-php-time-offset/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 5, 2010 Share Posted July 5, 2010 Yes, but you did not provide any information in your post as to what result you ARE getting vs what you expect. For all we can tell, you are then storing this information in a database and using DB query functions that are using the database's timezone setting and not matching the correct information. Quote Link to comment https://forums.phpfreaks.com/topic/206733-php-time-offset/#findComment-1081155 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.