473,387 Members | 1,492 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,387 software developers and data experts.

How to subtract time in '00:00:00' format?

I have a small application which is running every x minutes and I need
to display remaining time on the screen in this format (example):

"Next start will be in: 00:13:25"

, and it should automatically be subtracting second, and minutes, till
it all comes to zero and then my app will start.

I have this code I found somewhere on the internet:
Dim MyDate1 As DateTime = DateTime.Now
Dim MyDate2 As DateTime = MyDate1.AddHours(3000)
Dim difference as TimeSpan
code]

. but I am not getting the rest.
I would of course use some timer and so... but could someone help me
to get time changes displayed in so much needed '00:00:00' format?

thanks a lot

Martin
--------========--------
via www.dotnetboards.com

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #1
2 6575
Snip ---8<---
I have a small application which is running every x minutes and I need
to display remaining time on the screen in this format (example):

"Next start will be in: 00:13:25"

---8<--- Snip
Try String.Format("{0:HH:mm:ss}", Now). Here's a real simple console example

Module Module1
Dim WithEvents oTimer As Timers.Timer

Sub Main()
oTimer = New Timers.Timer(1000)
oTimer.Start()
Console.ReadLine()
oTimer.Stop()
End Sub

Private Sub oTimer_Elapsed(ByVal sender As Object, ByVal e As
System.Timers.ElapsedEventArgs) Handles oTimer.Elapsed
Console.WriteLine(String.Format("{0:HH:mm:ss}", Now))
End Sub
End Module

HTH

Mark
Nov 20 '05 #2
thanks a lot
martin

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Travis Pupkin | last post by:
Hi, When pulling the hour (or minute, or second, or day, or month, etc) from the server like: <%= hour(time) %> Is there a quick way (like, without an if then statement to check it and fix...
9
by: MGRIDEOUT | last post by:
Hello , I have a sub that gets all records in a table. Then displays the times in a drop-down list (ddlStartTime). My problem is that the ddl contain the date AND time. i.e. 9:00 AM in the...
3
by: joe ruggeri | last post by:
Hey All ... I'm developing in ASP/VBScript using DreamweaberMX, w/ an Access 2000 DB as the data source. The source of the data is coming from a third party, which I get as a CSV and import into...
1
by: Scott Dunham | last post by:
I'm trying to select records between 2 different times, but I can't seem to get Access to see anything other than the date. For instance, criteria "Between #11/12/2001 1:45:00 PM# and #11/12/2001...
14
by: Michael Barrido | last post by:
I have this for example: Dim iSeconds as int32 = 3600 '3600 seconds is one hour How do i convert it to "01:00:00" ? Please help. Thanks in advance!
4
by: sayli | last post by:
I have 00:01:00 in a string. I want to convert it into time format. How can i do this?
10
by: nussu | last post by:
Hi , i have 4 textbox's vertically , in that in first 3 textbox's i am entering values in time formati.e in HH:MM:SS .There is no am/pm after time format. for ex : a textbox has to accept only...
18
by: Dirk Hagemann | last post by:
Hello, From a zone-file of a Microsoft Active Directory integrated DNS server I get the date/time of the dynamic update entries in a format, which is as far as I know the hours since january 1st...
6
by: alexs | last post by:
hi, I'm moving a mysql database over to using db2 V9.5 The database is used by our radius server to store network accounting information from our switches. One parameter is the length of a...
4
by: ahmurad | last post by:
Dear Xperts, In my database table some fault code type records are inserted and the values are like bellows: Error:2/FC:10; 00:15:13 16/03/2009; Error:2/FC:20; 00:15:15 16/03/2009; ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.