Re: Date and time
| From: | John Holmes | Date: | Wed, 11 Aug 2004 10:55:18 +0000 |
| Subject: | Re: Date and time | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-193433@lists.php.net to get a copy of this message | ||
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