SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: date format

  1. #1
    SitePoint Addict
    Join Date
    Feb 2004
    Location
    Rome
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    date format

    Hello

    I have a foreach cyle which receives $date in all these possible combinations

    1 May 2007
    1 2007 May
    May 1 2007
    May 2007 1
    2007 May 1
    2007 1 May

    When I receive $date I want transform $date always in

    1 May 2007

    Any idea how to do that in an good way ?

    Thanks

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,424
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Code:
    date("j M Y", strtotime("May 2007 1"));

  3. #3
    SitePoint Addict
    Join Date
    Feb 2004
    Location
    Rome
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stymiee View Post
    Code:
    date("j M Y", strtotime("May 2007 1"));
    Thanks!


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
  •