Convert datetime to month

Discussion in 'PHP' started by Ratchet93, Sep 21, 2009.

  1. #1
    Hi!
    Still somewhat new to PHP, this should be a simple question:)

    $post_time is 2009-07-28 23:18:59
    How do I convert the datetime of $post_time into the word July?

    Thanks in advance.
     
    Ratchet93, Sep 21, 2009 IP
  2. sunchiqua

    sunchiqua Peon

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    $post_time = "2009-07-28 23:18:59";
    $timestamp = strtotime($post_time);
    echo date('F', $timestamp);
    
    PHP:
     
    sunchiqua, Sep 21, 2009 IP
  3. Ratchet93

    Ratchet93 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks a bunch, just what I needed:D
    Never used strtotime before, gonna do some reading right now:)
     
    Ratchet93, Sep 21, 2009 IP