Adding case to switch time

Well done posting formatted code in code tags! But....
Read this link: Arduino Forum