Re: [PHP] Date Issue



Thank you again Dan. Thought never crossed my mind the day being the 31st. That fixed it.

Richard L. Buskirk














On Mon, Mar 31, 2008 at 4:15 PM, <admin@xxxxxxxxxxxxxxxxxxx> wrote:
I tried that a big no go.
Seems if I do a +1 i get 2 months from now and a -1 gives me the current
month.



$month = date("F", mktime(0,0,0, date('m'), date('d'), date('Y')));
$zomonth = date("F", mktime(0,0,0, date("m")-1, date("d"), date("Y")));
$nmonth = date("F", mktime(0,0,0, date(m)+1, date(d), date("Y")));


$month echo's MARCH should be Feb
$zomonth echo's MARCH should be March
$nmonth echo's MAY this should be April

That's because you're using today's date('d');, which is 31.

February doesn't have 31 days, nor does April, so mktime() forces
them to the following month to correct the error.

--
</Daniel P. Brown>
Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283
.



Relevant Pages

  • Re: The Norman Kember affair may not be what it seems
    ... Are you ok Richard? ... Mind you although she was a willing companion in everysense, I'm not entirely sure I got very much for my money. ... I was there in the cupboard with the DV-cam as agreed and you wanted to enact the slide of a wood cut I showed you from the British Museum, the monk fucking the woman over a table and the other monk fucking him! ... He had trouble performing and moaned about 'this, that and the other' while the crew got bloated on tea from waiting around so long. ...
    (uk.media.tv.misc)
  • Re: OT: IBMs view on "Legacy Transformation" and how my philosophy parallels some of the keypoints
    ... > Hi Dan... ... Legal language isn't a black and white issue. ... Now it not "that networking" but "this ... changing its mind. ...
    (comp.sys.ibm.ps2.hardware)
  • Re: Create New User Group and set permissionslimits
    ... The big thanks goes to you for challenging my mind doing research and trying ... > Hi Dan ... I am disabled from the first Iraq war the ... >> family member that will change settings is my daughter I do not want to ...
    (microsoft.public.windows.group_policy)
  • Re: Has there ever been a court case over eBay feedback?
    ... Make up your mind. ... to satisfy a boorish demand from a non-entity like yourself makes me a phony, then by all means, regard me as a phony. ... There are probably at least several dozen David Saltrams on Usenet. ... There are probably several dozen Richard J Kinch's on Usenet also. ...
    (alt.marketing.online.ebay)
  • Re: __ Scumbag Jackbooted PIGS taser student at Kerry forum <= hey gun-nutters, how much tyran
    ... The emperors, chances, and aids are all preferred and equivalent. ... Richard, have a rubber test. ... You won't mind it. ... If does Sayed negotiate so naturally, whenever Osama spoils the ...
    (rec.skydiving)