Notes idiosyncrasy #843: @Date

Here’s another weird one.

@Date(y; m; d) supposedly resolves to the same thing as @Date(y; m; d; h; m; s) where h, m, and s are all equal to 0. Help says so, and subtracting one from the other results in 0.

However doing a calculation such as: @Modulo(@Integer(@Integer(maintextfield – @Date(2007; 12; 30))/86400);52)
… you get a different value than
@Modulo(@Integer(@Integer(maintextfield – @Date(2007; 12; 30; 0; 0; 0))/86400);52)

When subtracting the former from a date/time field in local time, the value changes early, in my case here 5 hours. Coincidentally the amount of my GMT shift.
However when subtracting the second from the same field the value changes as expected, as this  shift magically disappears.

Whether the result should be in GMT or local time is irrelevant, but the two should be the same. And documented in help for that matter.

Leave a comment