Announcement

Collapse
No announcement yet.

Date & Time Of Order - Who Controls?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Date & Time Of Order - Who Controls?

    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?

    #2
    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.
    Bob Ladden

    Comment


      #3
      same problem..less severe!

      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

      Tracey
      Tracey

      Comment


        #4
        Bob's right. The server is set to use GMT for the time of order.

        Comment


          #5
          So Chris

          Can I change the scripts to use a time other than the servers
          Owner of a broken heart

          Comment


            #6
            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.

            Comment


              #7
              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:
              Code:
              ($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
              Code:
              ($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
              Code:
              $sDate = $sDatePrompt . sprintf(" %2.2d:%2.2d GMT", $hour, $min);
              should be modified to use your time zone. E.g.
              Code:
              $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
              Code:
              ($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,
              Zoltan
              Actinic Software
              www.actinic.co.uk

              Comment


                #8
                Nice one Zoltan

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

                Comment


                  #9
                  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.
                  Bob Ladden

                  Comment


                    #10
                    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...?
                    John

                    Comment


                      #11
                      Date & Time Of Order - Who Controls??

                      The answer is obviously ... Zoltan.

                      zolty, get well soon, you big perl noob.

                      Comment


                        #12
                        Just stumbled across this in SD16.0.5 - surely the code should have been reviewed by this point? Comments on the code are from 2002!

                        Zoltans fix still works, however it's going to be painful cycling these files to allow for time saving.
                        Matt. M - SMR Enterprises Ltd.

                        Comment

                        Working...
                        X