Q: start and end date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
How can I find start date and end date of a month from month name in c#? So
for example if February is selected from a dropdown list for this year I
should set 2/1/2005 and 2/28/2005?
Thanks,
 
Create a new date/time object having (year, month, 1)
For 2nd use another and do addmonth(1).Adday(-1)
 
Start date is obviously not a problem. Given the start date is stored in a
DateTime variable startDate, obtain the end date as

startDate.AddMonths (1).AddDays (-1);

Eliyahu
 
Sorry, wrong link. Here it is

DateTime.DaysInMonth(m_Year, m_Month);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Excel Help with dates 2
Excel Forecasting Dates Out to the Day 3
month end date 6
dynamic drop downs 4
Datedif gives wrong result 1
Compare shorter date range against longer date range 2
CASTing a date 1
compare dates in MS access 2

Back
Top