473,321 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

computing time difference

hi guys..

i'm new to visual basic and i was wondering how to compute time in it..

i have this values 10:00:00 and 13:00:00

how do i get the difference between the two??

im using this in a sort of login logout program that im developing..

say for example ive logged in the user at 10:00:00 Am and logged out him/her at 1:00:00 PM.. how do i compute the difference?? please help. tnx
Feb 7 '08 #1
1 1090
VBWheaties
145 100+
hi guys..

i'm new to visual basic and i was wondering how to compute time in it..

i have this values 10:00:00 and 13:00:00

how do i get the difference between the two??

im using this in a sort of login logout program that im developing..

say for example ive logged in the user at 10:00:00 Am and logged out him/her at 1:00:00 PM.. how do i compute the difference?? please help. tnx
You'll want to use the DateDiff function:

dim nMinutes
dim nHours
dim lSeconds

nMinutes = DateDiff("n", "10:00:00", "13:00:00")
nHours = DateDiff("h", "10:00:00", "13:00:00")
lSeconds = DateDiff("s", "10:00:00", "13:00:00")

msgbox nMinutes & " minutes. " & nHours & " hours. " & lSeconds & "seconds."
Feb 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

39
by: Steven T. Hatton | last post by:
I came across this while looking for information on C++ and CORBA: http://www.zeroc.com/ice.html. It got me to wondering why I need two different languages in order to write distributed computing...
1
by: nggfx | last post by:
Hi All, We are in process of buying new licenses for our systems. I would like to know, whether DB2 WSUE would support 64 bit computing or not. The IBM notes says 'DB2 WSUE cannot create...
42
by: John Smith | last post by:
In a C program I need to do exponentiation where the base is negative and the exponent is a fraction. In standard C this would be something like t = pow(-11.5, .333), but with this combination of...
13
by: Xah Lee | last post by:
Today, a motherfucker Christophe Rhodes (aka Xof in irc://chat.freenode.net/lisp ) kicked banned me. Here's the few relevant excerpt. (full, unedited excerpt will be published if there is a public...
3
by: dave | last post by:
I need to compute an expiration date based on the number of hours, days, or months purchased. The expiration date needs to be expressed in minutes something like '1260481600'. How can I get the...
14
by: Aaron Watters | last post by:
So, in between skiing runs I noticed a Business Week cover story on "cloud computing". The article had lots of interesting information in it like about how somebody's mom used to be an airline...
0
by: knorth | last post by:
The DataServices World conference offers a program for those interested in technology for data integration and data access, with emphasis on service-oriented architecture (SOA), web-oriented...
3
by: Ty Oft | last post by:
Hello Bytes! Maybe my question seems a bit silly (as one could simply answer it "Well, what are you more passionate about?" or stuff like that - please don't answer like this), but I am in a bit...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.