validates time and checks for nulls