Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Daylight savings in DataWeave 2.0 dates

Tags:

mule

dataweave

is there a way to handle automatically daylight savings? I’m using the following transformation

%dw 2.0
output application/json
---
{'date': now() >> "EST"}

but the output is

{
  "date": "2019-08-08T06:45:16.663-05:00"
}

The timezone is -05:00, but taking daylight saving into account I want it to be -04:00

like image 562
Shoki Avatar asked Mar 03 '23 14:03

Shoki


1 Answers

The way to do this is to use relative (name based) timezones.

now() >> "America/New_York"
like image 119
machaval Avatar answered Mar 13 '23 06:03

machaval