Skip to main content
drewski7
Gold ⭐️⭐️
June 1, 2023
Solved

NiFi - Convert Current time to GMT+10:00

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")}

steven-matison
Platinum ⭐️⭐️
June 1, 2023

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

1 reply

steven-matison
Platinum ⭐️⭐️
Platinum ⭐️⭐️
June 1, 2023

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

Translate