why is "timezone()" giving a different value as the offset from GMT?

Certified Senior Developer

I am a little puzzled here.

I need to check if a dateTime value is past a given hour of the day. But there is an issue, since it has an unpleasant behaviour : since we updated to summer time, it is wrong by 1 hour !

In my record type (and user interface), the dateTime will display "6/8/2026 5:48 PM GMT+02:00", so I assume my timezone has a two hours offset.

However, when I use function "timezone()", it gives "60", which would be adequate (and it did for a while!) when we would still be with winter time.

Why doesn't timezone() give 120?

How is this possible ? Is it a known bug ? (we are using release 25.3). 

Do I have to create a specific constant with the right hour and remove the days to allow calculation?

Here is what I have now: 

a!localVariables(
  local!dateBegin: now(),

  local!heure: hour(local!dateBegin) + timezone()/60,
  local!minute: minute(local!dateBegin),

  local!isAfter17h: or(
    local!heure > 17,
    and(local!heure = 17, local!minute > 0)
  ),

  local!dayEnd: todate(local!dateBegin) + if(local!isAfter17h, 1, 0),

[...]

but it is wrong between 5 and 6 PM Disappointed

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data