View Single Post
  #1  
Old 01-14-2007, 09:30 PM
 
MCM MCM is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 114
 

Default Finding the current time and doing some math in the templates

The new products mod is a neat one (and will be neater when I get it to work ). What I'd really like to do, though, is add something to the title of each item to show that it's new. Given the date added field in the database, I'd like to use $Product.add_date as a variable in an equation that would take the current time, subtract the add time, and display *NEW* in the title if the difference was less than a certain amount of time (to be specified later). What I need to know is the following:

-how can I call the current time?
-how can I put together the math in the .tpl file? Is it as simple as $current_time - $Product.add_date < $specified_time in a logical statement?

Thanks!

Jeremy
__________________
Version 4.0.17/4.0.18
Reply With Quote