Home All Groups Group Topic Archive Search About
Author
5 Jan 2006 8:31 PM
JIM.H.
Hello
I have TextBox1 this keeps date and time information and I need to compare
this DateTime with the current DateTime and find difference in hour. How can
I do this in VB.Net?

Thanks,

Author
5 Jan 2006 8:48 PM
Marina
Yes. If d1 and d2 are both dates:

dt.Subtract(d2).TotalHours

I am not sure how your textbox contains the date and time, but you need to
parse that out into a date object.

Show quoteHide quote
"JIM.H." <J***@discussions.microsoft.com> wrote in message
news:10AA571D-FC52-4895-9079-215A97FBD8E3@microsoft.com...
> Hello
> I have TextBox1 this keeps date and time information and I need to compare
> this DateTime with the current DateTime and find difference in hour. How
> can
> I do this in VB.Net?
>
> Thanks,
>

Bookmark and Share