Re: Urgent DATA help needed

From: Date: Tue, 22 Mar 2005 19:53:29 +0000
Subject: Re: Urgent DATA help needed
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38998@lists.php.net to get a copy of this message
Chris Payne wrote:
Could anyone show me an example of how to do this? So to take 2001-07-05 and add 3 days to it?
To use SQL to do this:
SELECT FROM_DAYS((TO_DAYS('2001-07-05') + 3));
The TO_DAYS and FROM_DAYS are nice functions to use when you are fildling with dates as numbers (i.e. doing arithmatic operations to the dates). There are also a bunch of other function dedicated to do math operations to date and they are listed here: http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html

« previous php.db (#38998) next »