Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Form design in vb.net 7 34
Create XML 5 46
Definitions and default visual studio colors 5 58
fso.FolderExists("\\server\HiddenFolder$") 4 52
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

896 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

13 Experts available now in Live!

Get 1:1 Help Now