By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

changing a value in a DateTime object

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <bb*******@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
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

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.