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

How to set a countdown and conduct a comparison of time in visual basic

I currently have an app I am learning with. I design and redesign as I go. I am currently working with Time. The app currently has two timers that display current time local to client pc (As in not just my time) and UTC time.

Expand|Select|Wrap|Line Numbers
  1.     Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
  2.  
  3.         If ComboBox1.Text = "Local" Then
  4.             Clock1.ForeColor = Color.DimGray
  5.             Clock1.Value = Date.Now.ToString("HH:mm:ss")
  6.         ElseIf ComboBox1.Text = "Eve" Then
  7.             Clock1.ForeColor = Color.Black
  8.             Clock1.Value = Date.UtcNow.ToString("HH:mm:ss")
  9.         End If
  10.  
  11.         If ComboBox2.Text = "Local" Then
  12.             Clock2.ForeColor = Color.DimGray
  13.             Clock2.Value = Date.Now.ToString("HH:mm:ss")
  14.         ElseIf ComboBox2.Text = "Eve" Then
  15.             Clock2.ForeColor = Color.Black
  16.             Clock2.Value = Date.UtcNow.ToString("HH:mm:ss")
  17.         End If
  18.  
  19.  
Both clocks are displayed in 24h format so HH:mm:ss.

Now I want to allow the user to input either a fixed time or a quantity of time ie( 4Hours or 4 o'clock ) I am thinking it is just a timer with some kind of a reverse tick or a subtraction going on. I am not finding anything on this subject on line. Can someone please point me in the correct direction and perhaps post some relevant links.

I Also need to be able to compare two times and find the difference between them. Can I just do this like a normal math problem or do I need to do something with the time first.

Thanks

~S.Paul
Mar 31 '16 #1
0 969

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

Similar topics

10
by: John | last post by:
I have a problem, it's not with any code I have because... there is no code. When I run a blank visual basic 6 form, it opens up just fine. When I add a text box, a caption, and a button... it...
2
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
1
by: Robin Powers | last post by:
PROCESS CONTROLS/VISUAL BASIC PROGRAMMERS SALARY: TO $100,000 LOCATION: LOS ANGELES AREA Our Client has recently acquired process automation systems used to monitor and control their...
2
by: janice_2k | last post by:
Dear Sir/Mdm, I am writing this on behalf of my company. We bought the Visual Studio .NET Enterprise version but currently we need to use Visual Basic 6 for a small development. We are not able to...
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
4
by: Chris Asaipillai | last post by:
Hi there My compay has a number of Visual Basic 6 applications which are front endeed onto either SQL Server or Microsoft Access databases. Now we are in process of planning to re-write these...
1
by: Ronm | last post by:
Hey Guys, I have a problem which has been driving me crazy for the last days. I'm working on a small project involving: Visual Basic Acces Database ASP and adobe/macromedia Flash,
3
by: Saucer Man | last post by:
Is this only available as part of Visual Studio or can it be purchased separately? -- Thanks!
0
by: ganeshvkl | last post by:
hi my requirement is create control arrays at run time that i achived but i couldn't remove control array object at run time visual Basic 6.0 i attached this code Private Sub...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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,...
0
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...

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.