beachdaze Posted January 18, 2007 Share Posted January 18, 2007 Trying to change the date format from the default 0000-00-00 00:00:00 to something easier to read. Here is the Select statement:$query = "SELECT (name), (time), (location) FROM main ORDER BY time ASC";If I add the DATE_FORMAT (time, XXX) etc... (Where XXX is the usual D, Y Etc) I get syntax errors. Do I need to have a strtotime statement instead?? Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 18, 2007 Share Posted January 18, 2007 Did you try it?To format a date from MySQL's date format with date(), you do have to use strtotime()date("Y-m-d", strtotime($date));If you're working with the empty date, your strtotime() will result in 0, resulting in date thinking it's in 1970, the Unix Epoch. Formatting it using date() won't do you any good. 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.