Support Questions
Find answers, ask questions, and share your expertise

NiFi toDate() Function altering the date content

Explorer

i have been trying to convert a string to date using 

 

${test:toString():toDate('dd-MMM-yy HH.mm.ss.SSSSSSSSS'):format('dd-MMM-yy HH.mm.ss.SSSSSSSSS')}

 

my test attribute is like 13-MAR-20 15.50.41.396000000

 

when i'm using the above mentioned expression to convert the string to Date, it actually is changing the date as below:

 

test
13-MAR-20 15.50.41.396000000
 
time
18-Mar-20 05.50.41.000000000
 
please advise! community
 
2 REPLIES 2

Explorer

Could you suggest the correct way of using it

Explorer

i have been trying to convert a string to date using 

 

${test:toString():toDate('dd-MMM-yy HH.mm.ss.SSSSSSSSS'):format('dd-MMM-yy HH.mm.ss.SSSSSSSSS')}

 

my test attribute is like 13-MAR-20 15.50.41.396000000

 

when i'm using the above mentioned expression to convert the string to Date, it actually is changing the date as below:

 

test
13-MAR-20 15.50.41.396000000
 
time
18-Mar-20 05.50.41.000000000
 
please advise! community