Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 05-15-2018 11:54 AM - edited 08-18-2019 12:28 AM
Use the below expression language to convert into date
${<attribute-name>:toDate("MMM dd yyyy hh:mm:ss","GMT"):format("yyyy-MM-dd HH:mm:ss")}in the above expression language we are matching the input date by using toDate function and using format function we are formatting the date value to yyyy-MM-dd HH:mm:ss.
to get only the date then use format function until date i.e yyyy-MM-dd
${<attribute-name>:toDate("MMM dd yyyy hh:mm:ss","GMT"):format("yyyy-MM-dd")}Example:-
I'm having generateflowfile processor with new property dr added as
UpdateAttribute Configs:-
Added two properties in update attribute processor as below
gmt
${dr:toDate("MMM dd yyyy hh:mm:ss","GMT"):format("yyyy-MM-dd HH:mm:ss")}
not_gmt
${dr:toDate("MMM dd yyyy hh:mm:ss"):format("yyyy-MM-dd HH:mm:ss")} Output Flowfile attributes:-
In addition we can use timezone with format function also,For more details regarding date conversions refer to this link.
-
If the Answer addressed your question, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.