Extract day/month/year from this

Discussion in 'PHP' started by Fracisc, Feb 16, 2010.

  1. #1
    I cannot manage to extract day/month/year from this format: March 1, 1981

    Is there anyone who can help me? I need the month converted to "03".
     
    Fracisc, Feb 16, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    <?php
    
    $extract = strtotime("March 1, 1981");
    
    //output: 01/03/1981
    echo date("d/m/Y", $extract);
    ?>
    PHP:
     
    danx10, Feb 16, 2010 IP
    Fracisc likes this.