PDA

View Full Version : Date & Time Of Order - Who Controls?


Cheeky Monkey
08-Nov-2003, 08:18 PM
Who controls the actual date and time of each order?

My orders are being processed on UK (GMT) date/time but our H.Q. is in the USA (5 hours behind the UK). This means that if we print of an order at 7.00pm (up until 11.59pm) it actually shows that we have processed the order a day BEFORE it was actually received.

How/where do I change this. Incidentally the site is hosted on a UK server. Is that the problem?

rmladden
08-Nov-2003, 08:50 PM
I have the same problem. My server is in the US. The Perl function gmttime is used. If you look in the scripts, it is all over. I was going to try changing all of them to localtime, but I have not done it yet. I did change the e-mail confirmations to localtime.

TraceyHand
08-Nov-2003, 09:10 PM
My times are only an hour out but it is confusing!
Sometimes I don't know if the order time in Actinic is correct or the payment time, IYSWIM.
SOmeone has mentioned before why it's wrong and how to remedy it but I can't remember who!
Sorry, not much help was I?Much sympathy though, it is annoying
:rolleyes:
Tracey

cdicken
11-Nov-2003, 04:25 PM
Bob's right. The server is set to use GMT for the time of order.

garyhay
11-Nov-2003, 05:45 PM
So Chris

Can I change the scripts to use a time other than the servers

cdicken
12-Nov-2003, 03:08 PM
No idea. Zoltan is a bit poorly at the moment, but as soon as he is back at his desk I'll ask him to make a suggestion.

zmagyar
12-Nov-2003, 06:04 PM
Well, Chris has asked me to take a look when I'm feeling better. So I will do so when I'm feeling better. ;)

<fx: later>

Bob is correct, we are using GMT to avoid time zone confusion. However it looks like even GMT is confusing in some cases. I'm not sure the localtime function of perl is appropriate here because in some cases the server's local time is not the desired one. So some other perl changes are required here. Unluckily the changes should be done in a few places. At first lets change the order date. Just open ACTINIC.pm in a text editor and find sub GetActinicDate then find the following line in this function:($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = gmtime(time); Then adjust the time as required by adding (or substracting) seconds from the 'time' value. E.g. if you want the time to be displayed as a GMT-5 time then the above line should be modified as ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = gmtime(time - 5 * 60 * 60); If you save your changes and upload your site then all orders will be downloaded by using the adjusted times.
Lets see the next step then. If the confirmation mail date should be in synchron with the recorded order date then OrderScript.pl should be edited. There is the function {B}sub GenerateCustomerMail[/B] where the same line can be found. Just apply the same changes here and save the file. Please note that there is a line just a few lines below which contains the string 'GMT'. This should also be modified to reflect your real time zone. In other words the line$sDate = $sDatePrompt . sprintf(" %2.2d:%2.2d GMT", $hour, $min);should be modified to use your time zone. E.g.$sDate = $sDatePrompt . sprintf(" %2.2d:%2.2d PST", $hour, $min);The receipt page already uses the server's local time. If it is not appropriate then this can also be modified by editing [B]sub DisplayReceiptPhase[/B} in OrderScript.pl. Just find the line ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); and modify as appropriate. I would suggest to change this to the same as the one in GetActinicDate.

I hope this helps a bit.

BTW I hope you know the standard rules of the modification of the scripts, don't you? So please do it in your own responsibility.

Regards,

cdicken
13-Nov-2003, 08:13 AM
Nice one Zoltan

I'll get this added to all the relevant documentation.

rmladden
13-Nov-2003, 12:27 PM
Very very nice. My 6.1.3 OrderScript.pl used gmtime, which I had already changed to localtime and I also changed the date to US format for the e-mail confirmations.

jxm28788
30-Apr-2008, 05:25 PM
ok, so how does this work for us in the UK?

GMT is fine for half the year, then we get BST for the other half. As far as I can tell that means we'd need to adjust the scripts every 6 months...?

gabrielcrowe
01-May-2008, 08:29 AM
Date & Time Of Order - Who Controls??

The answer is obviously ... Zoltan.

zolty, get well soon, you big perl noob.

:cool: