Click here to Skip to main content
15,887,822 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to find the anniversary and birthdays that fall on a particular date range
Posted

1 solution

The answer is very simple: it is the full set of all dates in the given range. Why? Because "birthday" means day-months combination; and each of them is someone's birthday. There are no days which are "not birthdays". These simple speculations should show you how important to formulate problems precisely.

And the following hints are to teach you how important to solve problems by yourself. All you need is this:
http://msdn.microsoft.com/en-us/library/xcfzdy4x.aspx[^],
http://msdn.microsoft.com/en-us/library/system.datetime.compare.aspx[^] (but instead, use '==', '>', '<', '>=' or '<='),
http://msdn.microsoft.com/en-us/library/system.datetime.date.aspx[^],
http://msdn.microsoft.com/en-us/library/system.datetime.day.aspx[^],
http://msdn.microsoft.com/en-us/library/system.datetime.month.aspx[^].

The key hint: you need to ignore time and year part of the time. Also, you will need to resolve the problem: what to do if the given range has dates of more then one year.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900