Event listener for time format