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? 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. 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 Link to comment https://forums.phpfreaks.com/topic/83765-solved-date-formatting/#findComment-427130 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.