|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Calendar control questionHi I have a vs2003 .net calendar control and what I need to do is when the
user makes any selection for the entire month I need to get the year and month of the selection but then also need to get just the last day of that month and year. I looked at the calendar class but did not see anyway to return the last day of the selected month? Thanks -- Paul G Software engineer. This is not a function of the calendar control.
There is functionality in the DateTime class that can roughly handle this. Since the first day of the month is easier to get, simply get the first day of the following month and then subtract one day using the DateAdd method. Show quoteHide quote "Paul" <P***@discussions.microsoft.com> wrote in message news:20DABFCC-CE60-4B39-8722-26EAFC382EE7@microsoft.com... > Hi I have a vs2003 .net calendar control and what I need to do is when the > user makes any selection for the entire month I need to get the year and > month of the selection but then also need to get just the last day of that > month and year. I looked at the calendar class but did not see anyway to > return the last day of the selected month? > Thanks > -- > Paul G > Software engineer. ok thanks for the reply. I just implimented something and ended up using the
following that seems to be working, using System.Globalization; GregorianCalendar mycal =new GregorianCalendar(); int i_daysinmonth = mycal.GetDaysInMonth(i_year,i_month); -- Show quoteHide quotePaul G Software engineer. "Steve C. Orr [MVP, MCSD]" wrote: > This is not a function of the calendar control. > There is functionality in the DateTime class that can roughly handle this. > Since the first day of the month is easier to get, simply get the first day > of the following month and then subtract one day using the DateAdd method. > > -- > I hope this helps, > Steve C. Orr, MCSD, MVP > http://SteveOrr.net > > > "Paul" <P***@discussions.microsoft.com> wrote in message > news:20DABFCC-CE60-4B39-8722-26EAFC382EE7@microsoft.com... > > Hi I have a vs2003 .net calendar control and what I need to do is when the > > user makes any selection for the entire month I need to get the year and > > month of the selection but then also need to get just the last day of that > > month and year. I looked at the calendar class but did not see anyway to > > return the last day of the selected month? > > Thanks > > -- > > Paul G > > Software engineer. > > >
DataSourceControl and declarative SelectParameters
FileSystemWatcher does not seem to be working Javascript with Webcontrols Get cached value returned from Select() Print version use CSS or similar ? Sorting Datagrid SmartNavigation/MaintainScrollPositionOnPostback & Datagrids LinkButton field and FindControl Edit, Update, Cancel best practive with dropdown list controls in user controls |
|||||||||||||||||||||||