tinker74 Posted January 4, 2014 Posted January 4, 2014 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
burt Posted January 4, 2014 Posted January 4, 2014 Change define('DATE_FORMAT_LONG', '%A %d %B, %Y'); To define('DATE_FORMAT_LONG', '%A %B %j, %Y');
tinker74 Posted January 4, 2014 Author Posted January 4, 2014 @@burt I did as you said now my date looks like this: This product will be in stock on Saturday February 032, 2014.
jhande Posted January 4, 2014 Posted January 4, 2014 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 -
tinker74 Posted January 4, 2014 Author Posted January 4, 2014 @@jhande Pow....that did it...thanks a lot
jhande Posted January 4, 2014 Posted January 4, 2014 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 -
jhande Posted January 4, 2014 Posted January 4, 2014 @@jhande Pow....that did it...thanks a lot NP :thumbsup: - :: Jim :: - - My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -
burt Posted January 4, 2014 Posted January 4, 2014 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.
jhande Posted January 4, 2014 Posted January 4, 2014 @@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 -
burt Posted January 4, 2014 Posted January 4, 2014 Are you trying on a windows server? The comments in the page say to use %#d rather than %e %e should (and does) work on a linux server (real hosting account) - just tested at http://template.me.uk/testing/product_info.php?products_id=1
jhande Posted January 4, 2014 Posted January 4, 2014 @@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 -
♥14steve14 Posted January 5, 2014 Posted January 5, 2014 I found this page very helpful when I changed the date format on my invoices http://www.php.net/manual/en/function.date.php REMEMBER BACKUP, BACKUP AND BACKUP
Recommended Posts
Archived
This topic is now archived and is closed to further replies.