how can i format date in php

Discussion in 'Programming' started by mumfry, Jan 29, 2012.

  1. #1
    hello

    so i have a date formatted like this
    2011-01-29 11:04:53

    but how can i format it to get an output that looks like this
    Sunday, January 29

    any help or suggestions on this would be greatly appreciated

    Thanks
     
    Solved! View solution.
    mumfry, Jan 29, 2012 IP
  2. wvccboy

    wvccboy Notable Member

    Messages:
    2,632
    Likes Received:
    81
    Best Answers:
    1
    Trophy Points:
    250
    #2
    date ("I, F j") will give you Sunday, January 29.
     
    wvccboy, Jan 29, 2012 IP
  3. #3
    wvccboy is right,but the L in the date function is l
    $date="2012-01-29 11:04:53";// I think you want to say 2012
    $date=date("l, F j" , strtotime($date));
    echo $date;
     
    dany3l89, Jan 29, 2012 IP
  4. bambook

    bambook Greenhorn

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    all characters to use with date(): php.net/manual/en/function.date.php
     
    bambook, Feb 2, 2012 IP