imarockstar Posted February 11, 2010 Share Posted February 11, 2010 I need the MYSQL date format reformatted .. which the below does fine. But I was wandering if there was a function to automatically get the day of the week to be outputted as well ? <? $date = $rows['sh_date']; $newdate = explode("-", $date); $showdate = "".$newdate[1].".".$newdate[2].".".$newdate[0].""; echo $showdate; ?> Quote Link to comment https://forums.phpfreaks.com/topic/191781-help-with-reformatting-the-date/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 11, 2010 Share Posted February 11, 2010 http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format Quote Link to comment https://forums.phpfreaks.com/topic/191781-help-with-reformatting-the-date/#findComment-1010804 Share on other sites More sharing options...
imarockstar Posted February 11, 2010 Author Share Posted February 11, 2010 I did see that, however my problem is that i have over 500 records in my DB with the date stored like this : 2010-01-10. I didn't want to have to go add the day of the week to each of those records. Was not sure if there was a function that would somehow get the dat of the week based on 2010-01-10. Quote Link to comment https://forums.phpfreaks.com/topic/191781-help-with-reformatting-the-date/#findComment-1010805 Share on other sites More sharing options...
PFMaBiSmAd Posted February 11, 2010 Share Posted February 11, 2010 The date_format() function has absolutely nothing to do with adding anything to your columns. It returns information about date values (in columns or otherwise) and some of the choices listed include getting the day of the week, either as a three letter abbreviation, the whole day name, or as a number, depending on which formatting parameter you choose. Quote Link to comment https://forums.phpfreaks.com/topic/191781-help-with-reformatting-the-date/#findComment-1010810 Share on other sites More sharing options...
imarockstar Posted February 11, 2010 Author Share Posted February 11, 2010 ok either I am totally stupid or I explained my problem incorrectly .. um r both lol .. I am displaying my date this way via php : echo $rows['sh_date']; which is displayed as this : 2010-01-10 In php is there a function that takes 2010-01-10 and figures out what day of the week that is and then can return the new value to be displayed as : Wednesday January 10 2010 That link you sent me is confusing the hell out of me .. sorry for the stupidity .. b Quote Link to comment https://forums.phpfreaks.com/topic/191781-help-with-reformatting-the-date/#findComment-1010812 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.