Comparision of Time

Hi,
Need help for this case.I have the time which is in the format hh-mm-ss stored in a variable Time(String Type).My excel has a column that stores date and time both.Now I need to compare the time variable with each row in date and Time column in excel .

How to do that

Thanks and Regards,
Supriya

Hi supu123,

You are looking to compare time with Datetime. You can do in the below mentioned way:

Yourtimevariable = 12-33-23
Yourtimevariable.replace(“-”,“:”)
Yourtimevariable="05/02/2019 "+Time
Yourdatetimevariable = Datetime.parse(Yourtime variable)
Sheettimevariable = “04/02/2019 14:12:56”
Sheettimevariable="05/02/2019 “+Sheettimevariable.split(” "c)(1)
Sheetdatetimevariable=Datetime.parse(Sheettimevariable)
Output:
Yourdatetimevariable>Sheetdatetimevariable
Returns either True or False.
Hope this helps