changing a value in a DateTime object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to be able to change a DateTime object from 12:00 AM to 12:00 PM and I am struggling in doing so. Any thoughts would be helpful
 
bbdobuddy,
A DateTime value itself is immutable (un-changeable).

You need to create a new DateTime based on the existing DateTime.

Something like:

Dim aTime As DateTime
If aTime.Hour = 0 Then
aTime = aTime.AddHours(12)
End If


bbdobuddy said:
I want to be able to change a DateTime object from 12:00 AM to 12:00 PM
and I am struggling in doing so. Any thoughts would be helpful
 
Back
Top