MKTime (Month)

Discussion in 'PHP' started by Agent_Smith, Dec 8, 2008.

  1. #1
    Hello,

    Currently using :

     
    //$StatData['month'] is 11
    
    $Month = date("F", mktime($StatData['month']));
    PHP:
    Yet $Month shows December? I would prefer if it showed November! :cool:

    Thanks.
     
    Agent_Smith, Dec 8, 2008 IP
  2. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #2
    Why is that? It is December. If you always want it to be November, just write $month = 11;
     
    fireflyproject, Dec 8, 2008 IP
  3. Agent_Smith

    Agent_Smith Well-Known Member

    Messages:
    890
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    145
    #3
    Obviously its not always goign to be 11 as it is a variable which will change, else i would just print November in the html...

    Anyway, i managed to fix it with :

    $Month = date("F",mktime( 0 , 0 , 0 , $StatData['month']));
    PHP:
     
    Agent_Smith, Dec 8, 2008 IP