TimeOfDay always = 00:00:00 ?

snow1

Member
Joined
Apr 21, 2006
Messages
17
Programming Experience
Beginner
Can anyone help me on how to get the time from the local settings of my computer? DateTime.Today seems to work for me, it gives me the date today. But I'm having a problem with the DateTime.Today.TimeOfDay. it just gives me the default time, which is 00:00:00. The time in my settings is correct, by the way.
any idea on how to get the time?


Dim
tb2, tb1 As String
tb1 = DateTime.Today
tb2 = DateTime.Today.TimeOfDay.ToString
 
Today is today, as in this day. Now is now, as in thios moment. A day has no time component, so the time is zeroed to midnight as you see. Intellisense even says "Gets the current date" with no mention of time. Do as Kulrom suggests.
 
Back
Top