Re: date maniplations
| From: | Ankur Verma | Date: | Thu, 15 Feb 2001 04:48:04 +0000 |
| Subject: | Re: date maniplations | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39819@lists.php.net to get a copy of this message | ||
try using
strtotime()
http://www.php.net/manual/en/function.strtotime.php
hope that helps
best regards
Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India
----- Original Message -----
From: "Don" <don@lclcan.com>
To: "php list" <php-general@lists.php.net>
Sent: Wednesday, February 14, 2001 9:17 PM
Subject: [PHP] date maniplations
> Hello,
>
> Sorry if I am confused by the date functions in the manual but I am.
> Here's what I want to do:
>
> I have a string in the form MM/DD/YYYY. I wish to:
> 1) convert it to a date
> 2) add $n days to it
> 3) convert back to a string in the same format above
>
> I believe I can accomplish [2] and [3] with:
>
> $mytdate = date("m/d/Y",mktime(0,0,0,date("m")
> ,date("d")+$n,date("Y")));
>
> How do I accomplish step 1?
> Can I type cast a string to a date?
>
> Thanks,
> Don
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net