I have a question about the date format. I know that Knime has its default format “yyyy-mm-dd”, and from what I understand to change the format you have to transform the date column into a string, for example I have a creation date column which is in “yyyy-mm-dd” format, which is therefore of type date, but if I want to change that into “dd/mm/yyyyy” I have to change the type of the column into a string and to use for example the node string manipulation.
What I would like to know is if it is possible to have a date format “dd/mm/yyyy” while keeping the date type, can I use a java node and in which we would put some code ?
To give you more precision in my workflow, my output is a csv files and the date column must be in “dd/mm/yyyy” format while keeping the date type.
thank you in advance
if “dd/mm/yyyy” date format is only needed in output file then convert it just before export and before that you are able to work normally with date type.
Thank you for your answer,
Yes but if i convert before export my column will be string but i want to keep the date type in the export and the format “dd/mm/yyyy”.
Hi @didi , where are you exporting to? Or rather, what file type are you exporting to?
Any text type file (csv, txt, tsv, etc) doesn’t care of the column type. It does not have this concept. So you can format it however you want, it does not matter if it’s no longer of type date in Knime.
If you are going to export to an Excel file, it does have the concept of column type. However, it does not matter in which date format you will save it, Excel will most probably format it based on your locale setting, unless you actually save it as a string, and the Excel will leave the format as is as it would not see it as date.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.