I have been googling for hours now to find a right solution on my knime problem. How will I change the date format of the output report from yyyy-MM-dd to dd-MM-yy. I tried date&time to string node to get the format that I prefer. But when I use string to date&time node, the date format goes back to the original format.
Hi @jepavila & welcome to the KNIME community forum,
What you describe is the normal behaviour when converting a date (of string type) into a date (of data type). The former is just a “string” representation of the latter which is internally coded as a date.
If you need eventually to convert a column of type date into a column of type string with your favorite format, i.e. dd-MM-yy, then the best is to use a -Extract Date&Time Fields- node as follows:
Thank you for replying. I have actually tried this solution, but when I download the output report, I need the columns to be in date format not in string so I could filter it.
Should be:
If the column is in string, the output format is not in date format:
If I try to convert the string to date, the date format in the output report will go back to yyyy-MM-dd.
It looks like from your images that you are actually trying to format Excel and not KNIME. There are 2 ways of doing this. I will link to a previous forum answer that I had about formatting percentages. The options / process for formatting Dates in Excel files that are written from KNIME are the same.
As the friends told before, I understand the same. Whatever you export the data from knime if the excel region and date format show as your language configuration.
Some tips: Select the column from excel after import it and change the Column type as custom. You can set the way that it can be, or transform as data options with the mask one: mm-dd-yyyy or as you wish.
Excel will always chances the format with how it can be similar (date, numbers, texts…).
Tips 2: If you know powerquery from excel, you can transform this column as part of a treatment process, and the result will be as you wish too, but with benefits that you can update the import data and the excel will make all transformations that you had done.