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 = "-----"
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

All 3 Replies

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

Look on MSDN for TimeSpan or start with these examples

okay thanks!

Be a part of the DaniWeb community

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