Jump to content

Shipping Date is yesterdays date


wss-mike
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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'])); ?>';" />
Link to comment
Share on other sites

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.
 

Link to comment
Share on other sites

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 :D ... very happy.

Thank you both for your responses, very much appreciated.

 

Best Regards,

Mike.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...