473,788 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.AddHour s(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 6592
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(10 00)
oTimer.Start()
Console.ReadLin e()
oTimer.Stop()
End Sub

Private Sub oTimer_Elapsed( ByVal sender As Object, ByVal e As
System.Timers.E lapsedEventArgs ) Handles oTimer.Elapsed
Console.WriteLi ne(String.Forma t("{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
8849
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 it) to format it so it represents all hours in two digits like:
9
1907
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 table is 1/1/1899 9:00:00 AM in the ddl. How do I get JUST the Time in format 9:00 AM?? Please I have been at this now for over 2 days and I can't seem to get
3
1595
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 the database, updating it weekly. Since I have no control over how the data is collected, I'm not sure how to fix this problem, but here it is. This is a database of movies and among the many fields I import is one for the
1
8791
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 2:45:00 PM" returns all records on the 12th. Is there a trick here somewhere? The field is date/time format. Do I have to do something to split the date and time apart in order to get the filter to work right?
14
4101
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
11238
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
2904
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 time format as 23:00:00 . Now in textbox4 i need to calculate average of the above 3 textbox's i.e average of 3 textbox's time format whihc is in HH:MM:SS format. once i comeout of 3rd textbox the average of above 3 textbox's has 2 display in...
18
13047
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 1901. For Example: the number 3566839 is 27.11.07 7:00. To calculate this in Excel I use this: ="01.01.1901"+(A1/24-(REST(A1;24)/24))+ZEIT(REST(A1;24);0;0) (put 3566839 in field A1 and switch the format of the result-field to the corresponding...
6
6595
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 network session in seconds. In mysql there is a sec_to_time function which i then used to store the session time as a char string
4
2979
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; Error:2/FC:30; 00:15:16 16/03/2009; Error:2/FC:40; 00:15:20 16/03/2009; Error:3/FC:3; 00:20:13 16/03/2009;
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10366
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10112
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5399
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.