Hello !
We are about to start a webshop using the famous shoppingcart Cubecart, unfortunatly our server is localized on GMT and our webshop must be in CET.
The Cubecart don't have any build in function for setting the offset right and I need a codie who could help me !
At the Cubecart forums www.cubecart.com the closest answer I got to fix this was this reply (and this solution don't sound to good):
Well, there is a problem when you play with time. Kind of like the butterfly effect. A one hour adjustment is no problem, but if that one hour means it is the next day, and that next day means it is the first of the month, and that month happens to be January, so it is a new year, ugh. The same thing happens when adjusting backwards.
Anyway, the time is pulled in secure.php at the time of the order. Look for:
// todays date
$date = date("ymd");
// todays time
$time = date("H:i");
The code below will adjust for times over 24 and under 0, but does not change the day of the month. So, whatever adjustment you make, it will be wrong that many minutes x 2 per day. I don't recommend using it, but rather offer it as a sample of what considerations must be made.
// todays time
//$time = date("H:i");
$adjust = 0; //set your adjustment in minutes
$time_hour = date("H");
$time_min = date("i")+$adjust;
while($time_min>59)
{
$time_min=$time_min-60;
$time_hour=$time_hour+1;
if($time_hour>24)
{ $time_hour=$time_hour-24; }
}
while($time_min<0)
{
$time_min=60+$time_min;
$time_hour=$time_hour-1;
if($time_hour<1)
{ $time_hour=24+$time_hour; }
}
$time_hour=sprintf("%02d",$time_hour);
$time_min=sprintf("%02d",$time_min);
$time=$time_hour.":".$time_min;
It gets more complicated for figuring days months and years.
Any help would be appriciated !