How to use time package to parse and format a date