Converting Dates In Reverse

Discussion in 'PHP' started by bloard, Aug 14, 2008.

  1. #1
    I have some date data that is in this form "August, 14 2008" and I want to convert the word "August" along with the rest of the date to numerals so that I can use the time functions etc. I realize that I can do this by a short bit of code where I match the month and assign a numeric value, but I was wondering if there was any php function that I'm missing that does this for me?
     
    bloard, Aug 14, 2008 IP
  2. nabil_kadimi

    nabil_kadimi Well-Known Member

    Messages:
    1,065
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    195
    #2
    nabil_kadimi, Aug 14, 2008 IP
  3. ahowell

    ahowell Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    <?php
    
    $date = date_create('August, 14 2008');
    echo $date->format('m/d/Y');
    
    // Output: 08/14/2008
    
    PHP:
     
    ahowell, Aug 14, 2008 IP