Floob Posted September 26, 2002 Share Posted September 26, 2002 I have added the following line to my orders.php in admin <td class="main"><?php echo tep_datetime_short($order->info['date_purchased']); ?></td> This works fine, but is returning the date as MM/DD/YYYY Can anyone show me how to change it to DD/MM/YYYY ? Thanks for any pointers Floob. Link to comment Share on other sites More sharing options...
Floob Posted September 28, 2002 Author Share Posted September 28, 2002 Anyone have any ideas? I just want it to not display the time, just date - and for the format to be DD/MM/YYYY Thanks for any pointers Floob Link to comment Share on other sites More sharing options...
galen Posted September 29, 2002 Share Posted September 29, 2002 Have a look at this forum page It should give you a good idea on how to do what you are asking http://www.oscommerce.com/forums/viewtopic.php?t=7545& Regards Galen Link to comment Share on other sites More sharing options...
Floob Posted September 29, 2002 Author Share Posted September 29, 2002 Thanks - I'll take a look Link to comment Share on other sites More sharing options...
Floob Posted September 29, 2002 Author Share Posted September 29, 2002 Well I took a look - but I still dont get it. I have changed it to: tep_date_short Which gets rid of the time - but how do I get MM/DD/YYYY ? I think it is in the general.php in the admin section? I think this is pretty simple - but I just dont get where I should change the format. Anyone? Thanks Allen. Link to comment Share on other sites More sharing options...
Floob Posted October 20, 2002 Author Share Posted October 20, 2002 Can anyone help with this? I'll say 'thanks' and everything... :) I need to get <?php echo tep_datetime_short($order->info['date_purchased']); ?> to display as DD/MM/YYYY as opposed to MM/DD/YYYY Thanks for any help Floob. Link to comment Share on other sites More sharing options...
♥olby Posted October 20, 2002 Share Posted October 20, 2002 Look in english.php, or danish.php like this one, for: setlocale(LC_TIME, 'da_DK.ISO_8859-1'); 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('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S'); A windows search can help you out most of the time. Best Regards olby Link to comment Share on other sites More sharing options...
Floob Posted October 20, 2002 Author Share Posted October 20, 2002 Here is mine. What should I change? ====== setlocale(LC_TIME, 'en_US.ISO_8859-1'); 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('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S'); ====== Link to comment Share on other sites More sharing options...
Floob Posted October 20, 2002 Author Share Posted October 20, 2002 By the way - I am using this code in my admin section. Does that make any difference? Link to comment Share on other sites More sharing options...
Floob Posted October 20, 2002 Author Share Posted October 20, 2002 Ah I swopped it for the english.php in my admin area and it works!!! Thanks a lot. It now looks like: =============== // 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', '%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'); //// // 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); } } ============= Does that look correct to you? Link to comment Share on other sites More sharing options...
♥yesudo Posted October 28, 2005 Share Posted October 28, 2005 Another good link on this topic is: http://www.oscommerce.com/forums/index.php?sho...34entry529134 Your online success is Paramount. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.