DateTimePicker
-
Hi, How do i get the maximum number of days in a month using DateTimePicker? and how to display the current Time with a format (ex. 10:00 am)... and how to get the number of days from the first date that i picked until to the last date (ex. From : 01/12/06 To 01/14/06) result 2 days ? Pls i really need your help... thanks and more power... Welbert
-
Hi, How do i get the maximum number of days in a month using DateTimePicker? and how to display the current Time with a format (ex. 10:00 am)... and how to get the number of days from the first date that i picked until to the last date (ex. From : 01/12/06 To 01/14/06) result 2 days ? Pls i really need your help... thanks and more power... Welbert
welbert wrote:
How do i get the maximum number of days in a month
Date.DaysInMonth(theYear, theMonth)
welbert wrote:
how to display the current Time with a format (ex. 10:00 am)
Set the following DateTimePicker properties in the designer... Format = Custom CustomFormat = h:mm tt See MSDN for more formatting codes. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandarddatetimeformatstrings.asp[^]
welbert wrote:
how to get the number of days from the first date that i picked until to the last date
Get the selected date and time from the picker like this...
Dim myDate As Date = myDateTimePicker.Value
Get the number of days like this...myDate1.Subtract(myDate2).TotalDays