Re: Date and time
| From: | Aidan Lister | Date: | Wed, 11 Aug 2004 10:56:52 +0000 |
| Subject: | Re: Date and time | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-193434@lists.php.net to get a copy of this message | ||
That's a mysql timestamp, if you want to manipulate dates in PHP you'll need
to use unix timestamps.
You have a couple of options,
select unix_timestamp(myFld) as myFld from myTbl
Then just add 60*60*24*7 to it.
Or, parse it with:
function convert_timestamp ($timestamp)
{
$timestring = substr($timestamp,0,8)." ".
substr($timestamp,8,2).":".
substr($timestamp,10,2).":".
substr($timestamp,12,2);
return strtotime($timestring);
}
"Diff Fannehh" <phpu@go.ro> wrote in message
news:20040811103537.3928.qmail@s2.home.ro...
> Hi,
>
> I have this date in timestamp format:
>
> $a= 20040810114155;
>
> I want to add 7 days to this date. How can i do that?
>
> Thanks
>
>
>
> ----
>
> Home, no matter how far...
> http://www.home.ro