Re[2]: [PHP] date
| From: | Tom Rogers | Date: | Fri, 20 Feb 2004 00:40:01 +0000 |
| Subject: | Re[2]: [PHP] date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-178305@lists.php.net to get a copy of this message | ||
Hi,
Friday, February 20, 2004, 6:32:27 AM, you wrote:
JB> [snip]
JB> hi there
JB> how do i make php give me yesterday's date?
JB> i tried
JB> date("Y-m-d")-1
JB> but if today would be the 1st of july (2004-07-01), yesterday would be
JB> 00.
JB> july (2004-07-00) according to that calculator.
JB> is there any way to make this one get it right? without any
JB> if-structures if
JB> possible
JB> [/snip]
JB> http://www.php.net/strtotime
JB> --
JB> PHP General Mailing List (http://www.php.net/)
JB> To unsubscribe, visit: http://www.php.net/unsub.php
date('Y-m-d',strtotime('-1 day'));
--
regards,
Tom