bildwelt
E2E FORUM
E2E Bridge E2E Commerce

Reply To: How to check if a date is a DST day

E2E Forum Modeling & Development How to check if a date is a DST day Reply To: How to check if a date is a DST day

#1814

Alfred
Moderator

You need to write a little helper function.

In the helper function you need to query the timezone offset for a specific date. The timezone offset includes the DST offset and so you can check if the timezone offset changes for a date.
The daylight saving changes between two and three o’clock so you need to
query one time before (0) and one time after (4) the DST switch.

The format %z of printDateTimeExpression returns the timezone offset as +hhmm or -hhmm.

local dateTime_no_DST = convertToDateTime('2014-10-26T04:00:00+01:00');
local offset_no_DST = printDateTimeExpression(dateTime_no_DST, '%z', 'CET');
local dateTime_DST = convertToDateTime('2014-10-26T00:00:00+01:00');
local offset_DST = printDateTimeExpression(dateTime_DST, '%z', 'CET');

The value of offset_no_DST is for European timezone CET +0100.
The value of offset_DST is for European timezone CET +0200.

For another date which is not a DST day both offset would be the same.