Home All Groups Group Topic Archive Search About

how to get; number of days in a given month

Author
27 Dec 2006 4:51 PM
Ivan Jericevich


Author
27 Dec 2006 4:53 PM
Igor Jericevich
The .net framework data object supplies this functionality

Look at System.Date




Show quoteHide quote
"Ivan Jericevich" <i***@oberon.co.za> wrote in message
news:ezvKpbdKHHA.4928@TK2MSFTNGP06.phx.gbl...
>
>
Author
27 Dec 2006 5:01 PM
Kerry Moorman
Ivan,

Supply the year and month to DateTime.DaysInMonth.  For example:

Console.WriteLine(DateTime.DaysInMonth(2006, 11))

Kerry Moorman

Show quoteHide quote
"Ivan Jericevich" wrote:

>
>
>
Author
27 Dec 2006 10:39 PM
RobinS
"Ivan Jericevich" <i***@oberon.co.za> wrote in message
news:ezvKpbdKHHA.4928@TK2MSFTNGP06.phx.gbl...
>

Dim dt As Date = #2/5/2006#
Console.WriteLine("Days In Month = {0}", _
  DateTime.DaysInMonth(dt.Year, dt.Month))

gives you 28

Robin S.