Canman2005 Posted November 22, 2007 Share Posted November 22, 2007 Hi all Wondering if someone can help me. Basically I have two dates in the format of YYYY-MM-DD, so for example I might have; 2007-02-23 & 2007-03-12 What I need to do is to work out 1: how many weekends there are (sat & sun) 2: how many weekdays there are (mon - fri) 3: how many total weeks there are contained between the two dates I have. Is this easy to do? can anyone help? thanks so much dave Link to comment https://forums.phpfreaks.com/topic/78448-dates/ Share on other sites More sharing options...
Barand Posted November 22, 2007 Share Posted November 22, 2007 date ('w', strtotime($date)) will give the day of the week for a date. Loop between the 2 dates and count them. Link to comment https://forums.phpfreaks.com/topic/78448-dates/#findComment-397129 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.