Submitted

Score19

Originally posted on UserVoice

Use Case: calculating which Shift is working within a rotating-shift cycle, which must the follow Daylight Savings Time offset.

This function is available in the Performance Equation library, but not in AF. The function itself is simple once one knows it, but is not obvious (kudos to Nicola Gargano):

IsDst = Floor(Float('*'-'1-jan') / 3600) Mod 24 <> Hour('*')

It should be added to the AF function library.

For more background, see this link:

https://pisquare.osisoft.com/message/99046-re-need-isdst-function-is-daylight-savings-time-in-af#32418

Minor update to Nicola Gargano's original idea, if you try to put this into AF and backfill it you to another year you will get incorrect numbers. I've modified the equations slightly to account for this:

Floor(Float('*'-parsetime(concat("1-jan", String(year('*'))))) / 3600) Mod 24 <> Hour('*')

without the "year('*')" string it will pull the current year's version of January 1st :/