DIFF FanneHH wrote:

I have this date in timestamp format:

$a= 20040810114155;

I want to add 7 days to this date. How can i do that?

echo date('YmdHis',mktime(substr($a,8,2),substr($a,10,2),substr($a,12,2),substr($a,4,2),substr($a,6,2)+7,substr($a,0,4)));


Looks like a MySQL timestamp. If so, you can use

SELECT yourcolumn + INTERVAL 7 DAY FROM yourtable ...

in your query.

--

John Holmes

php|architect - The magazine for PHP professionals - http://www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to