How to convert YYYY-MM-DD date format to DD-MMM-YYYY with node or any other easy solution

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.

Hello @Paras,

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:

Br,
Ivan

2 Likes

@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.

Hi @Paras ,

You can also use Column auto type cast node.
Check this attachment: KNIME_project25.knwf (6.3 KB)

GL,
Mehrdad

4 Likes

Hello @Paras,

actually this is more simple than I thought. You can only use above mentioned Date&Time to String node with following Date format: dd-MMM-yyyy

See here:

Br,
Ivan

5 Likes

Hi @ipazin ,
Thank you once again for quick reply.
And also thank you for the solution. I am able to get the dates in desired format.

Cheers,
Paras.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.