Re: [PHP] DATE / strtotime

2009-04-19 Thread Ron Piggott
Thanks Chris. It has been a while since I used this command. Ron On Mon, 2009-04-20 at 13:27 +1000, Chris wrote: > Ron Piggott wrote: > > Where $date_reference is 2009-04-18 the following code gives me a day of > > 1969-12-30. How do I get it to be 2009-04-17? > > > > $previous_date = strto

Re: [PHP] DATE / strtotime

2009-04-19 Thread Jim Lucas
Ron Piggott wrote: Where $date_reference is 2009-04-18 the following code gives me a day of 1969-12-30. How do I get it to be 2009-04-17? $previous_date = strtotime("-1 days", $date_reference); $previous_date = date('Y-m-d', $previous_date); echo $previous_date; outputs 1969-12-30 Ron

Re: [PHP] DATE / strtotime

2009-04-19 Thread Chris
Ron Piggott wrote: Where $date_reference is 2009-04-18 the following code gives me a day of 1969-12-30. How do I get it to be 2009-04-17? $previous_date = strtotime("-1 days", $date_reference); $previous_date = date('Y-m-d', $previous_date); Slightly wrong syntax. $previous_date = strtotime

[PHP] DATE / strtotime

2009-04-19 Thread Ron Piggott
Where $date_reference is 2009-04-18 the following code gives me a day of 1969-12-30. How do I get it to be 2009-04-17? $previous_date = strtotime("-1 days", $date_reference); $previous_date = date('Y-m-d', $previous_date); echo $previous_date; outputs 1969-12-30 Ron

Re: [PHP] date(), strtotime(), Wed, Dec 31, 1969 ??

2002-05-03 Thread Philip Olson
Hi Robert- You may want to spend a little more time with basic PHP tutorials, see: http://www.php.net/links To answer your question, the problem is with variable/string use, not any PHP functions. $blah in particular. Use quotes around strings: $blah = '2002-05-02'; Read about string

Re: [PHP] date(), strtotime(), Wed, Dec 31, 1969 ??

2002-05-03 Thread Stuart Dallas
On 3 May 2002 at 12:04, ROBERT MCPEAK wrote: > $blah=2002-05-02; > $thedate = date("D, M d, Y", strtotime($blah)); > $echo "$thedate"; $blah will = 1995. Try putting quotes around the date... $blah = "2002-05-02"; -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscr

Re: [PHP] date(), strtotime(), Wed, Dec 31, 1969 ??

2002-05-03 Thread Rasmus Lerdorf
Because your strtotime() call is returning 0. Replace the '-' with '/' and I bet it would work. -Rasmus On Fri, 3 May 2002, ROBERT MCPEAK wrote: > Running PHP3 on a Linux box and I've got trouble with date(). > > Here's the code: > > $blah=2002-05-02; > $thedate = date("D, M d, Y", strtotime($

[PHP] date(), strtotime(), Wed, Dec 31, 1969 ??

2002-05-03 Thread ROBERT MCPEAK
Running PHP3 on a Linux box and I've got trouble with date(). Here's the code: $blah=2002-05-02; $thedate = date("D, M d, Y", strtotime($blah)); $echo "$thedate"; Why is $thedate resolving to Wed, Dec 31, 1969. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit