uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Products
       uTest
       uReserve
       uShop
       uStorekeeper
       uGolf
       uDirectory
       uSignIn
 Tech Support
       Support Policy
       Knowledge Base
            uTest
            uReserve
            uShop
            uStorekeeper
            uGolf
            uDirectory
            uSignIn
       Documentation
       Reference Sites
 Legal
       Software Piracy
       Legal Notices
       Privacy Policy
       Licensing
 Miscellaneous
       Reseller Info
       Contact Us
       Site Map
CGI - the time on the recieved order is not danish time?

Knowledge Base Lobby : uShop Support Conference : CGI Script Related Problems
Dec-16-17 08:12 AM EST
Original Message
CGI - the time on the recieved order is not danish time?
Author Marianne Topping on 12-13-2000 at 06:04 (EST)
I really need the recieved order to display the correct time ( Danish time ), as of now it's prob. usa time ;)
E-MAIL AUTHOR | TABLE OF CONTENTS

Table Of Contents
  RE: CGI - the time on the recieved order is not danish time? Bill Weiner, 2000-12-13 14:52:59 (1)
            CGI - the time on the recieved order is not danish time? Marianne Topping, 2000-12-14 04:19:57 (2)
                 RE: CGI - the time on the recieved order is not danish time? Bill Weiner, 2000-12-14 06:29:04 (3)

Messages In This Discussion
         1. RE: CGI - the time on the recieved order is not danish time?
        Author Bill Weiner on 12-13-2000 at 14:52 (EST)
Are you referring to showing the date on the order form in the format:

DD/MM/YYYY

Instead of the US format:

MM/DD/YYYY?

If so, then here are some instructions one how to reformat the date on the order form:

STEP 1: Make a backup of the "ushop-lib.pl" file...just in case.

STEP 2: Open the "ushop-lib.pl" file with any text editor such as WordPad.

STEP 3: Do a search on the following line:

$order_date = sprintf("%02d/%02d/%02d",$mon+1,$mday,$year);

And change it to:

$order_date = sprintf("%02d/%02d/%02d",$mday,$mon+1,$year);

STEP 4: Do a search on the following line:

$date_string = sprintf("%02d/%02d/%04d : ",$mon+1,$mday,$year);

And change it to:

$date_string = sprintf("%02d/%02d/%04d : ",$mday,$mon+1,$year);

STEP 5: Save the file (as TEXT if your editor asks)...and try it out!

The date that appears on the order form and the order reader should now be in the format DD/MM/YYYY.

Note that we may eventually make that date format change ourselves to the Danish version (as we have already done to the German version)... but right now, for maintainability's sake, we keeping the date format consistent through all language versions.
TABLE OF CONTENTS
                 2. CGI - the time on the recieved order is not danish time?
                Author Marianne Topping on 12-14-2000 at 04:19 (EST)
Thanks for the help, but no, that is not what I meant.

I'm talking about the time, not the date. I need to recieved order to display Central European Time.
TABLE OF CONTENTS
                         3. RE: CGI - the time on the recieved order is not danish time?
                        Author Bill Weiner on 12-14-2000 at 06:29 (EST)
Oh, I see. The date on the order form is currently based on the localtime of your server. We'll have to look into adding an easy way to adjust that based on whatever time zone you want (even if your server is located elsewhere). In the mean time, here are some instructions on change the date to be based on the Greenwich timezone.

STEP 1: Make a backup of your current ushop-lib.pl script ... just in case.

STEP 2: Open the ushop-lib.pl file with any text editor such as WordPad.

STEP 3: Do a search on the following line:

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();

And change it to:

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime();

STEP 4: Do a search on the following line:

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($date_string);

And change it to:

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($date_string);

STEP 5: Do a search on the following line:

$report .= " " . localtime() . "n";

And change it to:

$report .= " " . gmtime() . "n";

STEP 6: Save the file (as TEXT if your editor asks)... and try it out!

NOTE 1: The above changes with ensure that the date is based on "Greenwich" timezone on the order form, order reader, and diagnostic report. The date used internally by the "Coupon Manager" will still be based on the local time of your server... but that should not be a big deal.

NOTE 2: If you know how many seconds your time zone is ahead of the "Greenwich" timezone, then you may be able to adjust those lines in STEP 3, STEP 4, and STEP 5, by the corresponding number of seconds.

For example, if you know your time zone is 2 hours (7200 seconds) ahead of GMT time, then I think you could use these lines instead:

In Step 3:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time() + 7200);

In Step 4:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($date_string + 7200);

In Step 5:
$report .= " " . gmtime(time() + 7200) . "n";
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.