Advanced Search

Results 1 to 2 of 2

Thread: strtotime - Converting Dates

  1. #1
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default strtotime - Converting Dates

    Hello,

    How could i convert the string "18/04/2009" into the format "Sat 18th Apr 09"

    I've tried using this:

    Code:
    $EventDate = strtotime("$EventDate");
    $EventDate = date('D jS M y', $EventDate);
    But this doesnt work as the string isnt in the correct format

  2. #2
    Join Date
    Jul 2008
    Posts
    199
    Thanks
    6
    Thanked 58 Times in 57 Posts

    Default

    PHP Code:
    function eventDataConvert($date){
        list(
    $day$month$year) = explode('/'$date);
        
    $time mktime(000$month$day$year);
        return 
    date('D jS M y'$time);


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •