Solved

Need help with Elapsed time using Now in VB.Net 2003

Posted on 2007-03-22
1
250 Views
Last Modified: 2011-10-03
Hi,
Can anyone help with determining elapsed time?
Back when we used VB6 we had code that said something like:
StartTime = Now

Then in a different part of the code we had:
TimeNow = Now
TimeDifference = TimeNow - StartTime

Now in VB.NET 2003 I am getting errors that say: Operator '-' is not defined for types "Date'

What I really need to get is the time difference in seconds.

Any ideas?

Thanks,
Charlie
0
Comment
Question by:charlieb01
1 Comment
 
LVL 6

Accepted Solution

by:
Jon_Raymond earned 500 total points
ID: 18773351
use datediff:
DateDiff(DateInterval.Hour, Startdate, Now())
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question