Fix time format
Lower on window raise or close and some code cleanup