SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Dec 2004
    Location
    Charlotte
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    converting date in php

    Hello,

    I would like to convert the date 2005-05-10 (from MySQL) into May 5, 2005. Any ideas how I would go about doing this in a reusable function?

    Thanks

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    You can use date and strtotime to do that:

    PHP Code:
    $date date('F j, Y'strtotime('2005-05-10')); 
    ERIK RIKLUND :: Yes, I've been gone quite a while.

  3. #3
    SitePoint Addict
    Join Date
    Dec 2004
    Location
    Charlotte
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you.


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
  •