How to use time in if statements

You don't use == for string comparison, as its pointer equality, not value equality.