Fix parsing utc date
Remove code duplication