melissal Posted December 30, 2007 Share Posted December 30, 2007 If I have a variable which will give me a date in this format: 31/12/2007 or 31/1/2008, etc, Is there way to be able to tell which day of the week it will be? Quote Link to comment https://forums.phpfreaks.com/topic/83765-solved-date-formatting/ Share on other sites More sharing options...
GingerRobot Posted December 30, 2007 Share Posted December 30, 2007 You can, as long as you modify your date from from dd/mm/yyyy to the American mm/dd/yyyy <?php $date = '12/31/2007'; $day_of_week = date('l', strtotime($date)); echo $day_of_week;//Monday ?> The strtotime() function wont work with the UK formatted dates. Quote Link to comment https://forums.phpfreaks.com/topic/83765-solved-date-formatting/#findComment-426210 Share on other sites More sharing options...
melissal Posted January 1, 2008 Author Share Posted January 1, 2008 Thanks so much! That's perfect Quote Link to comment https://forums.phpfreaks.com/topic/83765-solved-date-formatting/#findComment-427130 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.