Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New dateformat


fraro

Recommended Posts

I would like to change the date format to YYYY-mm-dd. How should this look like:

 

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');



////

// 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);

 }

}

Link to comment
Share on other sites

There are numerous threads dealing with changing the date format. Please do a search using *date format* (be sure to use the asterisks both in front and behind your string and Search All Terms).

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...