Cool!
$date = date("Y-m-d H:i:s", time() + (31*86400)); had to add H:i:s but it
works perfect.
Thanks
-----Original Message-----
From: idx [mailto:[email protected]]
Sent: July-12-09 2:32 PM
To: CakePHP
Subject: Re: Add expiry date after created
Maybe try:
$date = date("Y-m-d", time() + (31*86400));
On Jul 12, 12:49 pm, "Dave Maharaj :: WidePixels.com"
<[email protected]> wrote:
> How can I add 31 days to a date created?
>
> When saving i have
>
> $date = date("Y-m-d");
> $date = strtotime(date("Y-m-d", strtotime($date)) . " +31 days");
> $this->data['Access']['expires'] = $date;
>
> but all I get is zeros
>
> The "created" field saves to the db as normal but I have an expires
> field where i simply want the date to be 31 days from created
>
> Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---