Hi everyone, can i check with you, if i want to compare time... how can i do that... i have the following code

time_One = Now
el_Time = time_One - time_Two
Label1.Text = Now.ToShortTimeString
If Label1.Text < "06:30:00 PM" Then
Label1.Text = "-----"
Else
Label1.Text = el_Time.ToString
End If

I want to compare the current time with "06:30:00 PM"... so if the current time is smaller than "06:30:00 PM", i will do an action... how should i code?

Please assist me! Thanks!

Recommended Answers

Look on MSDN for TimeSpan or start with these examples

Jump to Post

All 3 Replies

Not sure about this.
Use something like this:
Now.TimeOfDay.CompareTo() 'Function

okay thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.