Solved

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

Posted on 2007-03-22
1
224 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now