Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Detecting Holidays in .NET

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

840 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