Results 1 to 5 of 5
  1. #1
    ABW Ambassador Doug247's Avatar
    Join Date
    January 18th, 2005
    Location
    DE USA
    Posts
    931
    Formating Data Help Needed
    I am trying to format the date from a field in a mySQL database. I want have the date formatted as such Wed Dec 31. But for the life of me can not get it figured out. This is what I have

    PHP Code:
    .
    .
    .
    echo 
    date("D M j",$rows['Date']);
    .
    .

    Any Help is greatly appreciated.
    Thanks,
    Doug

  2. #2
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    How about this?

    Code:
    echo date("D M j", strtotime($rows['Date']));

  3. #3
    ABW Ambassador Doug247's Avatar
    Join Date
    January 18th, 2005
    Location
    DE USA
    Posts
    931
    Sweet Many Thanks!

    So the strtotime() function formats the data so it can be formatted by the date() function.... Seems kinda redundent am I missing something?
    Thanks,
    Doug

  4. #4
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Quote Originally Posted by itsupportnotes
    Sweet Many Thanks!

    So the strtotime() function formats the data so it can be formatted by the date() function.... Seems kinda redundent am I missing something?
    It formats the date so the date() function can understand it before reformatting it.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  5. #5
    Newbie
    Join Date
    November 13th, 2008
    Posts
    28
    strtotime takes a "string" that represents a date/time and turns it into a timestamp. The date function accepts either a timestamp or NULL which will automatically assume you are referring to the current time.

  6. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. HELP! Affilliate Data feeds Don't Have All Data Needed?!
    By garyaggregator in forum Programming / Datafeeds / Tools
    Replies: 6
    Last Post: July 22nd, 2011, 04:40 PM
  2. DYSE Formating
    By mmcbee in forum Cusimano.com Scripts
    Replies: 6
    Last Post: May 5th, 2005, 05:24 PM
  3. formating
    By buyyourstuff in forum Cusimano.com Scripts
    Replies: 3
    Last Post: March 28th, 2003, 01:43 PM

Posting Permissions

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