I have a timestamp field in my input table like this: yyyy-mm-dd hh24:mm:dd
, I want output sting like this: yyyymmdd
.
-
what format are you outputting to?– Tom VCommented Jun 26, 2015 at 9:45
-
output should be string like as YYYYMMDD– Lilantha LakmalCommented Jun 26, 2015 at 10:57
Add a comment
|
1 Answer
Just use the select values step. Convert the data type to a string and specify the mask:
yyyyMMdd
Note the mask is a java simpleDateFormat and you can google that for more details. It is case SENSITIVE.
The mask in PDI is only used for 3 things:
- Converting from the real data type to a string
- Display purposes when previewing data
- Any other time you convert to "text" i.e. CSV output, or bulk loaders.
If you are sending it to a target database as a timestamp then it will be whatever that target database uses as default format.