Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Detecting Holidays in .NET

Posted on 2007-11-13
3
Medium Priority
?
718 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 1000 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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

824 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