hello I'm trying to figure out how to compute the difference between 2 dates excluding weekends.I browsed the web on how to compute the difference between two dates and i somehow was able to understand it but i could not figure out how to compute the difference if I do not include the weekends and holidays, can some one point me to the right direction or give me some pointers for it,also if you know any good reference source it would be great thanks in advance.
sickpuppy18
0
Newbie Poster
Recommended Answers
Jump to PostIf you're using php 5.3+ there are some new classes that make this easier to accomplish.
<?php //Define out start and end dates $start = new DateTime('2011-01-01'); $end = new DateTime('2011-02-01'); //Define our holidays //New Years Day //Martin Luther King Day $holidays = array( '2011-01-01', '2011-01-17', ); …
All 4 Replies
chrishea
182
Nearly a Posting Virtuoso

diafol
mschroeder
251
Bestower of Knowledge
Team Colleague
cereal
commented:
Great suggestion!
+4
sickpuppy18
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.