Select to view content in your preferred language

Calculating if date is summer time

10-01-2018 12:25 PM
Occasional Contributor


I have an excel formula which tell me if a date is using summer daylight saving time or not. The formula is as follow and seems to work well in excel:


It returns true or false. I would like to implement to formula in my Survey123 form but so far I can't make it to work properly (or at all).

Let's say the survey have a Date field named "aDate". I tried changing the formula like so:


But it seems it doesn't work. Any help would be greatly appreciated.

To be clear, I know that we can get the current UTC offset of the device, but I would like to get the UTC offset of a date that the user selected (So that I can tell if it is summer time or not.)

SOLUTION: Ok I found a way to do it. Basicly, I implemented the algorithm found here (for US-Canada East time). To implement it. I had to use several Calculate question in a row. The basic pattern I followed was:

-Find weekday abreviation using:


-Convert the weekday to a number between 0 and 6 using something similar to this (adapt according to your language):


-Implement the algorithm using format-date(${dateObs},'%n') for months and format-date(${dateObs},'%e') for Day of month

2 Replies
Esri Esteemed Contributor

Hi Nicolas,

The formula you have doesn't translate directly into a formula that can be implemented in Survey123; while the formatting document is Excel, it does not implement Excel functions.  

Another formula would need to be created to check if the current date is within the DST timeframe (which varies by country).  Using the format-date() function, it could be possible to construct but would be rather complex.

0 Kudos
Occasional Contributor

Thank you for your help. I will report back here if I manage to do it.

0 Kudos