Re: [PHP] Date Issue



You need apostrophes (or quotes) around your args to date() in the
parameters...

date('m')

As it stands now, PHP assumes you mean the constant m
(http://php.net/define) and that's not defined, so they are all 0.

So you are passing in 0 to ALL the args.

You also should use E_ALL for your error_reporting so you would SEE
the error messages telling you about this.

On Mon, March 31, 2008 2:07 pm, admin@xxxxxxxxxxxxxxxxxxx wrote:
Not understanding why this is happening.

$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)));

echoing out the exact same month
March
March

Checked server timezone/date/time all is good. Am I half asleep at the
wheel on this one and just not seeing my mistake here?


Richard L. Buskirk

Hardware Failure: $4,000.
Network Outage: $15,000.
Always blaming the programmers for everything: Priceless.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

.



Relevant Pages

  • Re: Proper Way to Use [while] Loops
    ... I'm new to PHP and am trying to create a template from the ... set up a loop to post every item on the newspost table. ... // START MARKUP ... Using double quotes in a string enclosed with single quotes requires no escaping and vica versa. ...
    (alt.php)
  • Re: [PHP] Optimized PHP
    ... quotes "s where needed as they are parsed by PHP and instead use single ... echo 'This is some text'. ... by PHP looking for variables or other escaped characters. ... In an application where I am having some different settings for each of the ...
    (php.general)
  • RE: [PHP] Cannot send a hyperlink
    ... Yes you do not need quotes in the mailfunction. ... [PHP] Cannot send a hyperlink ... Your problem is the Headers are missing which allows the html content to ...
    (php.general)
  • Re: nesting JS in echos
    ... from html to php. ... the conversion went well, it was to use a php session cookie to stop the ... single quotes and double quotes needed in the doc.write and variable ... my mistake was to leave the image path in single quotes; ...
    (comp.lang.php)
  • Re: nesting JS in echos
    ... i'm trying to bury a JS script to rotate a photo, ... converted from html to php. ... syntax of the single quotes and double quotes needed in the ...
    (comp.lang.php)