Support Questions

Find answers, ask questions, and share your expertise

NiFi - Convert Current time to GMT+10:00

avatar
Expert Contributor

Is there a way to convert use expression language to convert the current time to a specific timezone. 

 

Here is what I have currently but that's GMT not GMT+10:00.

 

${now():format("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", "GMT")}

1 ACCEPTED SOLUTION

avatar

@drewski7   You are looking for something like this,  for "yesterday":

 

${now():minus(86400000):format('MM-dd-yyyy hh:mm:ss') }

Then change 24 hours to 10 hours and add not reduce:

 

${now():plus(36000000):format('MM-dd-yyyy hh:mm:ss') }

 

Let me know if this adapts to fit your use case!

View solution in original post

1 REPLY 1

avatar

@drewski7   You are looking for something like this,  for "yesterday":

 

${now():minus(86400000):format('MM-dd-yyyy hh:mm:ss') }

Then change 24 hours to 10 hours and add not reduce:

 

${now():plus(36000000):format('MM-dd-yyyy hh:mm:ss') }

 

Let me know if this adapts to fit your use case!