The expression doesn't really make sense. You can add a date interval to
another date, but you can't add an absolute date to another date. It really
doesn't evaluate to anything meaningful. For example, you can add X number
of days or X number of minutes or X number of hours to the current
date/time Now. Below you can add 7 hours 8 minutes 30 seconds, which is an
interval but 7:08:30PM is not a time INTERVAL itself. The other thing you
can do is get the amount of time that has elapsed between two date
expressions, like how man hours have passed in between Now and 7:08:30PM.
In either case, you should be using date functions that were designed for
such calculations, like DateAdd or DateDiff.
"Big Tony" <no**@somewhere.else.com> wrote in message
news:pm********************************@4ax.com...
I have a piece of code written in VS.NET 2003. It runs fine on one machine
and does not on another. It throws an invalid cast exception. Any idea why there is a difference between machines?
Dim CurDate As Date = Now
Dim SpecTime As Date = "#07:08:30 PM#"
Eception thrown here:
CurDate = SpecTime + CurDate