www.uburst.com www.uburst.com

"CGI - the time on the recieved order is not danish time?"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

CGI Script Related Problems
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"CGI - the time on the recieved order is not danish time?"
Posted by Marianne Topping on Dec-13-00 at 06:04 AM (EST)
I really need the recieved order to display the correct time ( Danish time ), as of now it's prob. usa time ;)
Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

RE: CGI - the time on the recieved ..., Bill Weiner, Dec-13-00, (1)
CGI - the time on the recieved orde..., Marianne Topping, Dec-14-00, (2)
RE: CGI - the time on the recieved ..., Bill Weiner, Dec-14-00, (3)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: CGI - the time on the recieved order is not danish time?"
Posted by Bill Weiner on Dec-13-00 at 02:52 PM (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.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . "CGI - the time on the recieved order is not danish time?"
Posted by Marianne Topping on Dec-14-00 at 04:19 AM (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.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
3 . "RE: CGI - the time on the recieved order is not danish time?"
Posted by Bill Weiner on Dec-14-00 at 06:29 AM (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";

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.