wss-mike Posted December 11, 2014 Posted December 11, 2014 Hi, I'm hoping someone has seen this issue before. I have googled for a solution to this problem without any success, I found someone had asked the same question in 2007 but nobody replied. I am using Cubecart V3 and when I click on "Ship today" in the order screen it comes up with yesterdays date. The hosting server is located in Singapore but looking at the server info it seems the time zone default is the USA (specifically UTC -6:00). I am in Australia and our time zone is UTC +11:00 (currently in daylight savings) I set the Time offset to +61200 (17 hours in seconds as that's the difference between the two zones) and now it shows the correct date in the top right corner of the admin page. But when I click on the "Ship today" option on the order screen it still comes up with yesterday's date and I have to correct it each time. Does anyone have any ideas on how I can fix this ? Any help would be greatly appreciated. Cheers, Mike. Quote
disco_ii_disco Posted December 11, 2014 Posted December 11, 2014 I don't have a copy of Cubecart 3, but in Cubecart 4 (which should be similar) you could edit the value in the onclick event of the "shipToday" checkbox. In Cubecart 4 you can find it in admin/sources/orderBuilder.inc.php around line 500: <input name="shipToday" type="checkbox" id="shipToday" value="checkbox" onclick="findObj('ship_date').value = '<?php echo strip_tags(date($config['dateFormat'], time()+$config['timeOffset'])); ?>';" /> Quote
bsmither Posted December 11, 2014 Posted December 11, 2014 The hosting server is located in Singapore but looking at the server info it seems the time zone default is the USA (specifically UTC -6:00). I am in Australia and our time zone is UTC +11:00 (currently in daylight savings) PHP should allow for the application to be able to specify the timezone to use. ini_set('date.timezone',"XXX"); where XXX is Australia/NSW or Australia/Victoria, whichever one best represents where your store is located. You would add this statement to the ini.inc.php script. This should override whatever the server administrator has set as default for your instance of PHP that is running your hosting account. Quote
wss-mike Posted December 18, 2014 Author Posted December 18, 2014 Hi, Sorry I haven't replied sooner, I have been off work for a few days. I added the ini_set parameter as bsmither suggested and then removed the time offset, the date at the top of the page is still the correct date, but now the Ship Today comes up with the correct date ... very happy. Thank you both for your responses, very much appreciated. Best Regards, Mike. Quote
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.