Re: strtotime()

From: Date: Mon, 23 Aug 2010 21:02:28 +0000
Subject: Re: strtotime()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-307630@lists.php.net to get a copy of this message
On Mon, 2010-08-23 at 16:04 -0400, Rick Pasotto wrote: > On my home machine running 5.3.2-2 in debian linux the commands: > > echo date('Y-m-d',strtotime('first day of this > month')).'<br/>'; > echo date('Y-m-d',strtotime('last day of next month')); > > give the expected results. > > I just got setup with a hosting provider running 5.2.13 on BSD and both > give '1969-12-31'. > > What could be causing this? The second command is straight from the > manual and the first is clearly implied. > > So far everything else seems to work as expected. > > -- > "Economics is extremely useful as a form of employment for economists." > -- John Kenneth Galbraith > Rick Pasotto rick@niof.net http://www.niof.net > The example you quote as being straight from the manual page is actually from the user-submitted code snippets, and I can't find the documentation to support it. I can only assume that it's possibly an experimental thing, or something that shouldn't work but by freak coincidence does occasionally. Maybe use mktime() instead to get the dates? Thanks, Ash http://www.ashleysheridan.co.uk

« previous php.general (#307630) next »