Solved

Detecting Holidays in .NET

Posted on 2007-11-13
3
706 Views
Last Modified: 2010-04-21
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
Comment
Question by:clickclickbang
3 Comments
 
LVL 22

Accepted Solution

by:
RedKelvin earned 250 total points
ID: 20277152
That is a tough one, this may be useful

http://www.codeproject.com/cs/samples/christianholidays.asp
0
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 250 total points
ID: 20277178
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
 
LVL 1

Author Closing Comment

by:clickclickbang
ID: 31409140
Thanks for the help!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now