SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,159
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Post problem on my date

    Hi, I am having problem on DATE,the date is stored in the database is like this 2012-05-06,now i want to retrieve the date and display on the textfield.but the format will be like this Feb/02/13.

    I tried my code but it's not working.

    lets assumed that i have successfully queried my database.
    Code:
       
         $mydate = $row['date'];
    
         $mydate = date(M/dd/yy,strotime($mdate));
    Thank you in advance.

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hint: look closely at the variable used in the strtotime (typo?)
    also you have not double quoted the format

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by litebearer View Post
    hint: look closely at the variable used in the strtotime (typo?)
    also you have not double quoted the format
    +1
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  4. #4
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,159
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by StarLion View Post
    +1
    Hi StarLion,thank you for correcting me my mistake...it's working now...

  5. #5
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,159
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by litebearer View Post
    hint: look closely at the variable used in the strtotime (typo?)
    also you have not double quoted the format
    Hi litebearer, My mistake,thank you for correcting me.


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
  •