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 Link to comment https://forums.phpfreaks.com/topic/95532-mysql-date_format-problem/ 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? Link to comment https://forums.phpfreaks.com/topic/95532-mysql-date_format-problem/#findComment-489109 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 Link to comment https://forums.phpfreaks.com/topic/95532-mysql-date_format-problem/#findComment-489640 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' ) Link to comment https://forums.phpfreaks.com/topic/95532-mysql-date_format-problem/#findComment-489657 Share on other sites More sharing options...
proctk Posted March 12, 2008 Author Share Posted March 12, 2008 thank you that worked Link to comment https://forums.phpfreaks.com/topic/95532-mysql-date_format-problem/#findComment-490145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.