Use dateformatter and local date formatter to read and write the dates