From: Rick Pasotto on 23 Aug 2010 16:04 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(a)niof.net http://www.niof.net
From: Ashley Sheridan on 23 Aug 2010 17:02 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(a)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
From: Daniel Brown on 23 Aug 2010 17:57 On Mon, Aug 23, 2010 at 17:02, Ashley Sheridan <ash(a)ashleysheridan.co.uk> wrote: > > 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? Relative date strings - specifically including those terms - are in PHP5 >= 5.3.0 exclusively, for now. I don't believe there are any plans to backport it to the 5.2 branch. Rick, if you want to add this as a "Documentation Problem" to http://bugs.php.net/, one of us will likely add it to the documentation, as it probably should not only be noted, but also be in an easy-to-find place (you know, such as right there on the strtotime() manual entry). -- </Daniel P. Brown> UNADVERTISED DEDICATED SERVER SPECIALS SAME-DAY SETUP Just ask me what we're offering today! daniel.brown(a)parasane.net || danbrown(a)php.net http://www.parasane.net/ || http://www.pilotpig.net/
From: "Daniel P. Brown" on 23 Aug 2010 23:38 On Mon, Aug 23, 2010 at 22:27, Rick Pasotto <rick(a)niof.net> wrote: > > After I sent my original post the one and only user comment on the > relative date strings man page was pointed out to me. So, it's there but > how many people make a habit of reading all the user comments? A few thousand per day, give or take. I do remember seeing which page had the note, but I don't recall which one. Can you send me the link so that I can pop that out and put the info in the documentation? -- </Daniel P. Brown> UNADVERTISED DEDICATED SERVER SPECIALS SAME-DAY SETUP Just ask me what we're offering today! daniel.brown(a)parasane.net || danbrown(a)php.net http://www.parasane.net/ || http://www.pilotpig.net/
From: Rick Pasotto on 24 Aug 2010 00:37
On Mon, Aug 23, 2010 at 11:38:41PM -0400, Daniel P. Brown wrote: > On Mon, Aug 23, 2010 at 22:27, Rick Pasotto <rick(a)niof.net> wrote: > > > > After I sent my original post the one and only user comment on the > > relative date strings man page was pointed out to me. So, it's there but > > how many people make a habit of reading all the user comments? > > A few thousand per day, give or take. > > I do remember seeing which page had the note, but I don't recall > which one. Can you send me the link so that I can pop that out and > put the info in the documentation? http://us2.php.net/manual/en/datetime.formats.relative.php -- "There are always three speeches, for every one you actually gave. The one you practiced, the one you gave, and the one you wish you gave." -- Dale Carnegie Rick Pasotto rick(a)niof.net http://www.niof.net |