proctk Posted March 11, 2008 Share Posted March 11, 2008 HI I have then below that is supposed to return a reformated date from a field in a mysql date field in my table. users.spousedob = 1978-03-11 DATE_FORMAT(users.spousedob, '%a %b %e') The is returning Saturday, March 11 2008 but should be returning Tuesday, March 11 2008 Any ideas how to fix this Thank you Quote Link to comment Share on other sites More sharing options...
uniflare Posted March 11, 2008 Share Posted March 11, 2008 have you tried using the php strtotime() function? Quote Link to comment Share on other sites More sharing options...
proctk Posted March 11, 2008 Author Share Posted March 11, 2008 The problem is the date value in the mysql tabel. I need to somehow use mysql to change the date from 1978-03-11 to 2008-03-11. any ideas how to change the year Quote Link to comment Share on other sites More sharing options...
discomatt Posted March 11, 2008 Share Posted March 11, 2008 Oh, trying to grab a birthday, huh? Try this : DATE_FORMAT( CONCAT( '2008-', MONTH(`users.spousedob`), '-', DAY(`users.spousedob`) ), '%a %b %e' ) Quote Link to comment Share on other sites More sharing options...
proctk Posted March 12, 2008 Author Share Posted March 12, 2008 thank you that worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.