[Bug?] "Now" block is still using DST, but Mexico stop using it last year

I have a rule with a “now” block that start to trigger off time first Sunday of April. That day in Mexico, we use to start Daylight Saving Time, but not anymore since last year. The core “now” block is still shifting to the DST, but it should not.

I’m using the “now” block in a user library that did not call DST, but I think the core block should be, mmm… fixed? to stop using DST in región=México.

EDIT: Just forgot to state that my xububtu server shows the correct time, without DST shift, with “date” in the CLI

(I tried to report this possible bug in gthub, but I get really lost there…)

If there is a bug and not a configuration problem, it needs to be fix in the upstream js-joda library. We don’t actually maintain the code that implements stuff like timezones here. Or if not there, it’s part of core Java libraries.

Have you tried updating your installed Java?

AFAIK yes, all my packages are up to date. What made me think it was a bug is the different response between the core “now” and the user library (dateTime), Both blocks even give the same description when hoover: that they got the system-clock date and time in the current time zone…But if it is not related with openHab, I guess I just can keep using the dateTime library untill fixed.

(The second line is the log for the core “now”. The third is library’s dateTime “now”)

Although, looking at the code in the blocks, It seems that both are getting the same date-time (time.ZoneDateTime.now()), aren’t they?

var deibich_blockly_ZonedDateTime = Java.type('java.time.ZonedDateTime');

console.info((time.ZonedDateTime.now()));
console.info(deibich_blockly_ZonedDateTime.now());

No they are not actually.

This is coming from the js-joda library.

This is coming from Java.

Just to be clear, it’s the time.ZonedDateTime.now() that’s wrong, correct?

If so, at this point the best I can recommend is to file an issue on the openhab-js repo. See How to file an Issue for detailed instructions on how to file an issue.

I can’t promise this can be fixed by OH but it might be we just need to upgrade the version of js-joda we are using.

If it’s the second Java one, I don’t think there’s anything OH can do about it. That’s part of core Java and nothing we have control over.

Got it! Now I understand.

Yes time.ZonedDateTime.now() is wrong. I’ll file the issue and hope it could be fixed.

Thanks!