Jump to content

converting dates on the fly


anujgarg

Recommended Posts

I am trying to converting a date to the number of days it is old. Means, I have the date in my DB as 2008-09-20 00:00:00 and I want to convert this to 11 as it is 11 days old from the current date.

 

I am running a query of update as:

select * from table where added_date = "2008-09-20 00:00:00"

 

But I want this query to be executes as:

select * from table where added_date = "11" (The total number of days it is old)

 

How can I do it?

 

Am I specific to my ques?

 

Link to comment
https://forums.phpfreaks.com/topic/126574-converting-dates-on-the-fly/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.