KAllbritain

vb.net/2005

When I extract the hour from a datetime by:

Dim dt99 As DateTime = DateTime.Parse("12:00:00 am")
Dim dtp99 As New DateTimePicker
dtp99.Value = dt99
iHr = dtp99.Value.Hour

MsgBox(dt99.ToString & " : " & iHr)


I get the proper datetime value but the hour is wrong.

It works for every hour of the 24 hour day except 12:00:00 AM.

For that time the hour returned is 0.

Has anyone seen this
Fixes, workarounds

I found this in a calendar app when selecting times between midnight and 1:00am the hour was always 0.






Re: Visual Basic Language Bug in DateTime when extracting hours??

ArranNyc

In the 24hour clock, 12:00:00AM is the 0 hour.



Re: Visual Basic Language Bug in DateTime when extracting hours??

KAllbritain

now i feel really stupid.
thks