Formatting Date fields

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.

The use of a mask to format a date in an Output step is analogous to the mask used when you convert a Date to a String by using a Select values step.

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.

Note that the Date ...

Get Learning Pentaho Data Integration 8 CE - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.