[ 
https://issues.apache.org/jira/browse/NIFI-14620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17957944#comment-17957944
 ] 

Beat Fuellemann commented on NIFI-14620:
----------------------------------------

Hi Daniel
I see. That means, the toDate() method will always use the timezone, where nifi 
is running on. Afterwards we can the convert with formatInstant() into a 
timezone we need.

In that case it is important to correct the documentation for toDate() in 
https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#todate.
There is written: "The date will be evaluated using the local time zone unless 
specified in the second optional argument".
The second argument (timezone) has no effect anymore, correct? As well the 
examples are wrong then.

Thanks for clarify

> EL toDate() always uses local timezone
> --------------------------------------
>
>                 Key: NIFI-14620
>                 URL: https://issues.apache.org/jira/browse/NIFI-14620
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 2.4.0
>         Environment: OS: RedHat 9.5
>            Reporter: Beat Fuellemann
>            Assignee: Daniel Stieglitz
>            Priority: Major
>
> I use a parameter date "20250601". Nifi is running in CEST timezone.
> Now I need to generate a date in UTC based on the parameter "date".
> If I use UpdateAttribute Processor with 
> ${date:toDate(''yyyyMMdd,'UTC')}, it generates the timestamp "Sun Jun 01 
> 00:00:00 CEST 2025". I would expect "Sun Jun 01 *02:00:00* CEST 2025".
> I also already tested it with timezone "Europe/Kiev" or "America/Detroit", I 
> always get "Sun Jun 01 00:00:00 CEST 2025".
> It looks, that this Nifi expression Language method "toDate" always uses the 
> local timezone.
> In release 1.23.2 it was working fine.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to