Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Where is 'now( )' defined?


npn2531

Recommended Posts

Posted

In product_reviews_write.php the form on the page inserts the value (or function) for 'now ( ) ' into the field reviews.date_added. Where is 'now ( )' defined?

 

Currently this results in a dated being displayed like "Thursday 22 July, 2010" . I'd like to change that format.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Posted

The "now()" function simply tells the database to use the current date/time. It has nothing to do with the format.

 

The displayed date format is defined by the DATE_FORMAT_LONG (in english.php) and is generated by the tep_date_long() function (see product_reviews.php for an example of where that happens). You can simply change product_reviews.php to use something other than tep_date_long(), or you can change DATE_FORMAT_LONG -- but if you do change DATE_FORMAT_LONG, it will change throughout osCommerce and not just in the product reviews.

 

More information on the date string format can be found here.

Check out Chad's News.

Posted

now() is the system current timestamp (stored as Unix style integer value), and is exclusive to SQL. Note that it is not quite the same as the PHP time() call -- PHP's time() is GMT, while (My)SQL's now() is apparently corrected for the time zone. In any case, be careful not to mix them, as they don't give the same time result!

Archived

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

×
×
  • Create New...