24 hours from current time

  • Thread starter Thread starter Tim
  • Start date Start date
* "Tim said:
How can I tell if 24 hours has past from now?

It's christmas, I know, but are you sure you had a look at the members
of the 'DateTime' structure before posting your question?
 
For example:

KNOWNDATE = 12/22/2003 10:13:00 AM

How can I get the number of hours between Now() and
KNOWDATE

Tim
 
For example:

KNOWNDATE = 12/22/2003 10:13:00 AM

How can I get the number of hours between Now() and
KNOWDATE

Tim
 
* "Tim said:
For example:

KNOWNDATE = 12/22/2003 10:13:00 AM

How can I get the number of hours between Now() and
KNOWDATE

\\\
Dim KnownDate As Date = DateTime.Parse(...)
MsgBox(KnownDate.Subtract(DateTime.Now).Hours.ToString())
///

As an alternative, you can use 'DateDiff'.
 
Herfried K. Wagner said:
\\\
Dim KnownDate As Date = DateTime.Parse(...)
MsgBox(KnownDate.Subtract(DateTime.Now).Hours.ToString())
///

As an alternative, you can use 'DateDiff'.

In addition:
Instead of the Hours member you, Tim, can use the TotalHours property.
 
Back
Top