Remedy DST Time addition problems

When the DST match doesn’t appear to add up:

Here’s the original ARS List post I put out:

Fortunately this issue SHOULD be very straight forward.

Unfortunately – it isn’t.

There’s a button that calculates a person’s period of eligibility to make changes to their HR benefits, etc.  You enter their employment anniversary date and hit the button and this performs a calculation:

$My Date$ – 864000 (i.e., minus 10 days).

Here’s the interesting thing – when the date entered is  Daylight savings time – 3/15 this spring – the calculated value for the date time field returns 3/4/2010 11:00:00 PM.  Normally all of the times in this date/time field are left at 12:00:00 AM and are unused.

Technically speaking the calculation is EXACTLY correct.  3/4/2010 11:00:00 PM is exactly 10 days before 3/15/2010 12:00:00 AM – because 3/15 has an “extra” hour added that is a figment of our collective imagination.  Technically DST doesn’t happen until 2:00 AM though but that’s a matter for another time.

I was thinking about changing the times on these to default to 3:00:00 AM instead of 12:00:00 AM – but I’m open to suggestions.

As it turns out the solution was really simple – the original math for the “Set Fields” calculation did this:

$My Date$ – 864000

I just switched it to use the Remedy DATEADD function and added negative 10 days – this only evaluates the “date” portion of the value and ignores DST:

DATEADD(“day”,-10,$My Date$)

Thanks to C.B. on the arlist for the suggestion.


About admin

Comments are closed.