Compare between two given time

Hello Everyone
I stuck in a task, Where I have to do the comparisons between the given time.

One time is that User has selected and the other time is the current time.
If the selected time is crossed from the current time then the text should show “Time crossed” and
if the selected time is yet to come compare to the current time, then the text should show “Available”. for more clearance here is the example that what I want.
e.g
Selected time = 1:20
Current time = 2:00
The text should show “Available”
and
Selected time = 4:20
Current time = 2:00
The text should show “Time crossed”

Is there anyone who can help me for the same
Thanks in advance!

To answer your specific example…

When selected time < current time show “Available”

When selected time ≥ current time show “Time Crossed”

(but isn’t that the wrong way round?)

But what if the selected time is 12:50 and the current time is 1:00
will bubble compare according to time or according to number
as per your example :-

When selected time < current time show “Available”
When selected time ≥ current time show “Time Crossed”
so
12:50 < 1:00
will bubble compare according to time or according to number

This is a comparison of dates.

This topic was automatically closed after 70 days. New replies are no longer allowed.