brown2005 Posted August 17, 2006 Share Posted August 17, 2006 change 2006-05-31 as it comes out of the database to say Monday 31st May 2006 Quote Link to comment https://forums.phpfreaks.com/topic/17858-date/ Share on other sites More sharing options...
trq Posted August 17, 2006 Share Posted August 17, 2006 [url=http://php.net/date]date[/url](). Quote Link to comment https://forums.phpfreaks.com/topic/17858-date/#findComment-76292 Share on other sites More sharing options...
wildteen88 Posted August 17, 2006 Share Posted August 17, 2006 Well you'll want to use strtotime to convert 2006-05-31 into a timestamp and then use the date function convert 2006-05-31 into the date format you want. Quote Link to comment https://forums.phpfreaks.com/topic/17858-date/#findComment-76294 Share on other sites More sharing options...
brown2005 Posted August 18, 2006 Author Share Posted August 18, 2006 could u show me some code please wildteen... ive been trying and i cant get it to work...$date = $blog_array[blog_date]; Quote Link to comment https://forums.phpfreaks.com/topic/17858-date/#findComment-76610 Share on other sites More sharing options...
GingerRobot Posted August 18, 2006 Share Posted August 18, 2006 [code]<?phpfunction parsedate($date){ $str = strtotime($date); $today = date('Y-m-d'); $todaystr = strtotime($today); $diff = $todaystr-$str; $newdate = date('l jS \of F Y',time()- $diff); return $newdate;}?>[/code]Im not sure if it is necessary to use this: $today = date('Y-m-d'); $todaystr = strtotime($today);Perhaps i could have simpy used the time() function, but i wasn't sure if i may run into problems given that the format of the date being passed to the function is the Y-m-d and as such will not include the time for any hours during that day. Quote Link to comment https://forums.phpfreaks.com/topic/17858-date/#findComment-76630 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.