stanj Posted June 14, 2011 Share Posted June 14, 2011 I've been running a store for several years that has been modified a lot. Suddenly at June 12th 23:59:59 time the displays of short_date switched from dd/mm/yyyy to mm/dd/yyyy in the Admin portion of the store. Also in one field where the date is correct in RAW format in the database, only displays 6/1/2012 for every record that was created from June 13 00:00:00 and later. Strange. Checked the data base, no difference in the raw data but so it is a display problem. I checked backup copies of the admin orders.php and functions and classes that would impact this, nothing has changed. Any ideas. date_long() functions work normally. Is there some PHP date anomaly that everyone is aware of but me that occurs right on my birthday...June 13? Link to comment Share on other sites More sharing options...
stanj Posted June 14, 2011 Author Share Posted June 14, 2011 I've been running a store for several years that has been modified a lot. Suddenly at June 12th 23:59:59 time the displays of short_date switched from dd/mm/yyyy to mm/dd/yyyy in the Admin portion of the store. Also in one field where the date is correct in RAW format in the database, only displays 6/1/2012 for every record that was created from June 13 00:00:00 and later. Strange. Checked the data base, no difference in the raw data but so it is a display problem. I checked backup copies of the admin orders.php and functions and classes that would impact this, nothing has changed. Any ideas. date_long() functions work normally. Is there some PHP date anomaly that everyone is aware of but me that occurs right on my birthday...June 13? An update observation. The date displayed increments counting from June 13= 01/06/2012 and now it is June 14th here and displays 02/06/2012 as if 12 month minus 13 day offset...Is that a meaningful clue? Link to comment Share on other sites More sharing options...
germ Posted June 15, 2011 Share Posted June 15, 2011 The date is also influenced by /admin/includes/languages/english.php At the top it has a block of code something like this (default value): // look in your $PATH_LOCALE/locale directory for available locales.. // on RedHat6.0 I used 'en_US' // on FreeBSD 4.0 I use 'en_US.ISO_8859-1' // this may not work under win32 environments.. 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('PHP_DATE_TIME_FORMAT', 'm/d/Y H:i:s'); // this is used for date() define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S'); If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
germ Posted June 15, 2011 Share Posted June 15, 2011 I think I duplicated your problem. In my admin I changed the /admin/includes/languages/english.php time settings to typical UK format: setlocale(LC_TIME, 'en_UK.ISO_8859-1'); // #Credits to Brian Sim (aka Simmy) http://www.oscommerce.com/forums/index.php?showtopic=129520&st=0&p=520992# define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime() define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime() define('DATE_FORMAT', 'd/m/Y'); // this is used for date() define('PHP_DATE_TIME_FORMAT', 'd/m/Y H:i:s'); // this is used for date() define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S'); I looked at an order in the DB and the date was like this: '2011-06-13 01:02:03' Doing a tep_date_long('2011-06-13 01:02:03') gave me: Monday 13 June, 2011 Great. That's what it should be. BUT, if I take that and switch the month and the day like this: '2011-13-06 01:02:03' Doing a tep_date_long('2011-13-06 01:02:03') gave me: Friday 06 January, 2012 or 01/06/2012 as you posted. If I change it to '2011-14-06 01:02:03' I got: Monday 06 February, 2012 or 02/06/2012 as you posted. Check the date format in the orders in the DB 06/12 & before and compare that to the date format 06/13 & after. I'm not sure what that tells us but if the date format in the orders suddenly switched we will at least know why you see what you see. Next step would be to figure out why the date format switched. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
germ Posted June 15, 2011 Share Posted June 15, 2011 Oh gee.. Maybe a case of "open mouth, insert foot" on my part... :blush: Somehow I had the impression you were in "jolly old England". Just as I made my last post I saw the location in your profile: St Petersburg Russia I remember just enough about world geography to know that's probably not very close to "jolly old England". :huh: Like Forrest Gump said: "Stupid is as stupid does". I had a friend that always used to say: "Stupid should hurt". I'm glad it doesn't - I don't like pain.... :lol: So what are the date settings in the typical Russian Admin anyway? :unsure: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.