I have date in the table with format YYYY-MM-DD. But I want to convert it into DD-MMM-YYYY format. Can anyone please help me I have tried a lot but i am not able to do so.’
For Eg- wants to convert from 2021-04-13 to 13-Mar-2021
Thank you in Advance.
I suggest to work with format you have so you can use Date&Time based nodes (I assume you have Local Date column type) and then prior to exporting data convert your column to string using
Date&Time to String node and then further manipulate it to format you want using join() and substr() functions.
See here for more:
When converting string to date format using string to Date/Time node,the format for date column changed to yyyy-mm-dd from dd-mm-yyyy.
@ipazin Thanks for reply.
I have tried the given solution but it returns output in DD-MM-YYYY
Whereas I want the output in DD-MMM-YYYY format. Kindly suggest solution for the same.
You can also use
Column auto type cast node.
Check this attachment: KNIME_project25.knwf (6.3 KB)
actually this is more simple than I thought. You can only use above mentioned Date&Time to String node with following Date format:
this is a pretty simple workflow that does not use legacy nodes:
If you are fine with ‘23-Jan-20’ as output, you don’t need the String Manipulation node which converts ‘Jan’ to ‘JAN’. The last node simply gives you a flow variable if desired.
Here is the workflow to download: current_exec_date.knwf (10.8 KB)
Thank you once again for quick reply.
And also thank you for the solution. I am able to get the dates in desired format.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.