parse time correctly