When sending dates to a file, you have to provide a mask indicating which format to apply to the date when saving it. For formatting dates, you can use the same mask notation as explained at the beginning of the chapter.
To show an example of this, let's go back to the tutorial where we wrote the dates to a file. The mask we used for the date field was yyyy-MM-dd. This caused the first line belonging to January 1st, 2017 to be written as 2017-01-01. If for example, we had used the mask yyyy-MMM-dd, the same date would have been written as 2017-Jan-01.