[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

time subtraction !!

Posted on 2002-03-14
3
Medium Priority
?
252 Views
Last Modified: 2012-05-04
i am having 2 text boxes both are having time as the text in standard format how can i subtract both the times and get the net time for which the application was running?
0
Comment
Question by:pranay01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:RanjiniPraba
ID: 6867553
Hi,
you can use the Datediff() function whereby you will have to pass 3 arguments,
two of which are the dates for which you have to find the difference. the last argument is the format in which you want the difference like h for hour, s for seconds, m for months, d for days, etc. once you get the difference, you can convert it in to time again which is a simple arithmetic.
0
 

Accepted Solution

by:
stevengann earned 150 total points
ID: 6877464
Dim TheDate As Date   ' Declare variables.
Dim Msg
TheDate = InputBox("Enter in this format ->  " & Now)
Msg = "Hours from now: " & DateDiff("h", Now, TheDate)
MsgBox Msg
Msg = "Minutes from now: " & DateDiff("n", Now, TheDate)
MsgBox Msg
Msg = "Seconds from now: " & DateDiff("s", Now, TheDate)
MsgBox Msg
0
 

Author Comment

by:pranay01
ID: 6878832
thanx it worked!!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

656 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