473,473 Members | 1,491 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to calculate the difference in time

102 New Member
I have an app that captures the start time and end time of a process.

Start time:
Expand|Select|Wrap|Line Numbers
  1. lbl_Start.text = Now()         ' display start time
  2. Dim STARTx As DateTime = Now() ' capture start time
  3. '
  4. 'Code follows
  5. '
  6.  
End Time
Expand|Select|Wrap|Line Numbers
  1. '
  2. 'Code ends
  3. '
  4. lbl_STOPx.text = Now()        ' Display End Time
  5. Dim STOPx As DateTime = Now()  'Capture End Time
  6. Dim spanx As TimeSpan = STOPx.Subtract(STARTx) 'compute total time
  7. lbl_POTotalTime.Text = spanx.ToString ' display total time 
  8.  
All I get is nothing for the displaying end time and nothing foe the computation of end time. What's wrong?
Jan 25 '18 #1
1 1860
Luuk
1,047 Recognized Expert Top Contributor
Try to change line #7 to:
Expand|Select|Wrap|Line Numbers
  1. lbl_POTotalTime.Text = spanx.Milliseconds.ToString ' display total time 
If than helps, than this should be cause by your default date-format?
Jan 27 '18 #2

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

Similar topics

0
by: shrishjain | last post by:
Hi All, I want to write a benchmark to calculate the time of each memory access, in my program. Can someone give me an idea how to do that, or may some software which I can use for the same. ...
7
by: walt | last post by:
Hello, I have been trying to calculate the difference between two date and display the difference in hours and minutes (HH:MM). I can't get it calculate properly and I can't hours and minutes to...
2
by: Lancelot | last post by:
Hello everyone. This is my first post here, but I've been looking for answer many time. I have a crazy idea in my head and since I am quite a newby to python, I am not sure where to start or if...
6
by: lenygold via DBMonster.com | last post by:
Here is my input table: TUE MON ----------- ----------- 2 - - 25 27 - - 48 50 - - 78
7
by: orajat | last post by:
hi, how do i calculate difference in time in seconds (00:09:05 - 00:09:00 = 300) where start time being a field and the difference in time is calculated in AHT field, ie last record minus previous...
4
by: lenygold via DBMonster.com | last post by:
I found this example in MYSQL: create table events ( id integer not null primary key , datetime_start datetime not null , datetime_end datetime not null ); insert into events values ( 1,...
3
by: John Torres | last post by:
how do you calculate total time hours? I have sub total hours for each day and I've been trying to total all the hours. I'm getting odd numbers. Thanks. John
2
by: Guruganesh | last post by:
i have to calculate the time diference of two file names namely File 1: CBE03KMD_2010_03_08_23_06_36.upl File 2: CBE03KMD_2010_03_08_22_11_47.upl see the date is same but the time is also...
0
by: Syed Khaleel Ahamed | last post by:
Dear Sir, I want to get the difference of date/time captured in mysql and present date/time in jsp. I am using the following code to get, but its getting difference only in hrs, i used...
3
by: GLK913 | last post by:
Moving Excel HR data into an Access database to better manage the information and I've come across a problem trying to figure out how to write the code/expression to calculate accrued time off. I...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.