How to check if time variable is correct

Hello all, I am testing to check if a DateTime.Now is comprehended between two specified times, the variables i am using are:

and my condition:

but I get an error saying “16:30” is not a valid date time(using this for testing purposes), my final time lapse to check will be between midnight and thirty minutes past midnight, what am I doing wrong?

@goncalo.rocha

Please use HH:mm and not hh:mm

HH - 24 hours format

hh - 12 hours format

Cheers

Hi @goncalo.rocha ,

Try using

DateTime.Parse("16:30")

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.