Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Convert from Military time


Ken_Shea

Recommended Posts

Posted

Are you asking about the time zone your shop is indicating, or about the format the time and date are presented in? What do you mean by "military time"... a 24 hour clock?

Posted

Yes, replace the 24 hour clock, called Military time to standard time, not sure what was the developers purpose on this, likely one universality.

Posted

Most Europeans use a 24 hour clock, and they don't call it "military time". That's really only a U.S.-centric thing.

 

I don't have the details with me at the moment (I'm at work), but somewhere in osC is the template used to format the time and date in various situations. Try the two "configure.php" files for a start and see if the formats are in there. I'll try to remember to check on it tonight if it hasn't been resolved by then.

 

Are you showing the right time (time zone), and just don't like the format? If the time is off, you'll have to specify the correct time zone somewhere.

 

Finally, I see in your signature that you have "Encrypted Credit Card with CVV2". I hope you're storing credit card information with the blessing of your bank and in a fully PCI-DSS compliant manner, or you'll be in serious trouble the minute you get hacked. Just a friendly warning...

Posted

Most Europeans use a 24 hour clock, and they don't call it "military time". That's really only a U.S.-centric thing.

 

I don't have the details with me at the moment (I'm at work), but somewhere in osC is the template used to format the time and date in various situations. Try the two "configure.php" files for a start and see if the formats are in there. I'll try to remember to check on it tonight if it hasn't been resolved by then.

 

Are you showing the right time (time zone), and just don't like the format? If the time is off, you'll have to specify the correct time zone somewhere.

 

Finally, I see in your signature that you have "Encrypted Credit Card with CVV2". I hope you're storing credit card information with the blessing of your bank and in a fully PCI-DSS compliant manner, or you'll be in serious trouble the minute you get hacked. Just a friendly warning...

 

I live in the USA so it's called Military time here but I'm good with the 24 hour clock if you prefer.

Sure, if you find something on the time setting I'd be interested as others I am sure.

 

I'm not Amazon here, what orders I get are handled very promptly, card information is 256 bit SSL protected, then further encrypted in the data base, this mod also fully deletes the CC info from the data base when orders are printed. My old site was PCI compliant, till this goes through a compliance scan it isn't though. Of the many millions of sites that take credit cards it is a extremly low possibility that any one will get hacked, if they get this one it won't be like winning the lottery for them. I do use very strong passwords on all my sensitive data. That said, you are very correct, if credit card data is comprimised one can (not will) be in for a big financial hurt.

 

Note: Taking credit cards is not the same as "storing" that information, which is not done here at the store or on the web site server..

Posted

I found 3 places where the time is formatted to 24 hour clock:

/admin/includes/classes/phplot.php: var $x_time_format = "%H:%m%s";
/admin/includes/languages/english.php: define('DATE_TIME_FORMAT', 'DATE_FORMAT_SHORT' . ' $%H:%M:%S');
/includes/languages/english.php: define('DATE_TIME_FORMAT', 'DATE_FORMAT_SHORT' . ' $%H:%M:%S');

 

The %H code is hours in 24 hours with a leading 0. See PHP's strftime() function for the full list of codes (http://us3.php.net/strftime). Replace it with %l for for ' 1'..'12'. You'll probably want to add %p for AM/PM or %P for am/pm.

 

I'm not sure if the phplot.php is using quite the same format or is in error. %m should be the month number and %s should be Unix timestamp integer.

Posted

Just what the doctor ordered :)

Changed the admin/includes/languages/english.php

was: define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

Changed to:

define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %a:%I:%M:%p');

 

Order out put for time is now (for example) Sun:03:20:PM

 

Will see what shows up with regards to the other instances of time format and go from there, but for the orders listing in Admin is is now exactly what I was wanting.

 

Thanks again.

Ken

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...