Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Date Format Not Working For Me


tinker74

Recommended Posts

Posted

I can not seem to get my date format the right way....it currently reads like this:

 

This product will be in stock on Saturday 01 February, 2014.

 

I need to say:

 

This product will be in stock on Saturday February 1, 2014.

 

I have looked at my catalog/includes/languages/english.php and it is set up as follows:

 

@setlocale(LC_TIME, 'en_US.ISO_8859-1');

 

define('DATE_FORMAT_SHORT', '%m/%d/%Y'); // this is used for strftime()

define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()

define('DATE_FORMAT', 'm/d/Y'); // this is used for date()

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

define('JQUERY_DATEPICKER_I18N_CODE', ''); // leave empty for en_US; see http://jqueryui.com/demos/datepicker/#localization

define('JQUERY_DATEPICKER_FORMAT', 'mm/dd/yy'); // see http://docs.jquery.com/UI/Datepicker/formatDate

 

////

// Return date in raw format

// $date should be in format mm/dd/yyyy

// raw date is in format YYYYMMDD, or DDMMYYYY

function tep_date_raw($date, $reverse = false) {

if ($reverse) {

return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);

} else {

return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);

}

}

 

What am i missing here?

 

Thanks...Steven

Posted

I can not seem to get my date format the right way....it currently reads like this:

 

This product will be in stock on Saturday 01 February, 2014.

 

I need to say:

 

This product will be in stock on Saturday February 1, 2014.

 

I have looked at my catalog/includes/languages/english.php and it is set up as follows:

 

define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()

 

Change this:

define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()

 

To This:

define('DATE_FORMAT_LONG', '%A %B %d, %Y'); // this is used for strftime()

 

A quick Google search for "PHP strftime" revealed this: http://php.net/strftime

 

Oop's sorry... big fingers and bad eye sight.

 

Thank you Burt for posting the correct letter.

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

Humm...

 

I tried %e, and the date disappeared all together. :(

 

But %d, works it just displays with a leading zero - January 06, 2014.

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

@@jhande

 

Pow....that did it...thanks a lot

 

NP :thumbsup:

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

Hm, oh well. %e should give the number without the leading zero.

I didn't actually try it though, so will go with what you say.

Posted

@@burt

 

I was hoping for the non-leading zero format myself. But for some reason it broke and displayed nothing at all. Bummer... :wacko:

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

@@burt

 

Thank you Gary for pointing that out and testing.

 

Yes I had a really big DUH moment... My site is still on my laptop (Windows XP).

 

:blush:

 

:-

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Archived

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

×
×
  • Create New...