Solved

Detecting Holidays in .NET

Posted on 2007-11-13
3
707 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 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