[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 720
  • Last Modified:

Detecting Holidays in .NET

Experts, I have an application that needs to detect the various holidays throughout the year. Christmas, Thanksgiving, Easter, etc. Is there a way to do this with the .NET DateTime class or is there another standard method? Let me know what you experts do :)

Thanks for the tips, links, and advice!

~ C
0
clickclickbang
Asked:
clickclickbang
2 Solutions
 
RedKelvinCommented:
That is a tough one, this may be useful

http://www.codeproject.com/cs/samples/christianholidays.asp
0
 
Jaime OlivaresSoftware ArchitectCommented:
There is not such funtion, I think, Holiday is a relative term.
Nobody in the world celebrates Thanksgiving, with exception of USA.
You can put your desired holiday collection and design your own function:

Something to start:

public class Holiday
{
private static List<DateTime> Holidays = null;
public static void FillHolidays
{

}
public static bool IsDateAHoliday(DateTime date)
{

}
}
0
 
clickclickbangAuthor Commented:
Thanks for the help!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now