billy_111 Posted June 2, 2010 Share Posted June 2, 2010 Hey, I am trying to figure out how to convert a date format to show the Week Commencing. Take a look at this page: http://www.glofamily.com/glo/fitness-courses/ You can see it shows wc Wednesday June 2nd, 2010. This is today's date, now i need to convert this to say wc Monday May 31st, 2010. Now just to keep my code short this is what i have currently: $week = mysql_fetch_array(Course::getWeek()); $week = $week['week']; //This is taken out of a database $week = strtotime($week); $week = date("l F jS, Y",$week); //I need to convert this if possible Can this be done? Thanks again Kind regards Billy Quote Link to comment https://forums.phpfreaks.com/topic/203623-how-to-convert-date-to-show-week-commencing/ Share on other sites More sharing options...
Adam Posted June 2, 2010 Share Posted June 2, 2010 Assuming $week contains an actual date, you should be able to just change your strotime() line to: $week = strtotime('last sunday + 1 day', $week); Quote Link to comment https://forums.phpfreaks.com/topic/203623-how-to-convert-date-to-show-week-commencing/#findComment-1066595 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.