Work (business) days calculations with C#
If you think it’s a decent solution vote for it! :) Work days between 2 dates: public static double GetBusinessDays(DateTime startD, DateTime endD) { double calcBusinessDays = 1 + ((endD-startD).TotalDays * 5 – (startD.DayOfWeek-endD.DayOfWeek) * 2) / 7; if (endD.DayOfWeek == DayOfWeek.Saturday) calcBusinessDays –; if (startD.DayOfWeek == DayOfWeek.Sunday) calcBusinessDays –; return calcBusinessDays; } Note … Continue reading Work (business) days calculations with C#
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed