add more robust time format handling