[Solved] On the Pi the Time.zone not working

I think that's the common behaviour.
If you want a localized version of the epoch time, you'd use Time.local() instead of Time.now().
As Time.now() will always (irrespective of your Time.zone() setting) return the seconds since 1.1.1970 00:00 UTC.
Time.now() in turn will return seconds since 1.1.1970 00:00 in your set time zone.

But all other functions (e.g. hour(), timeStr(), format()) expect a UTC based time to give you a correct result, since the localization happens internally.


ScruffR:
I moved the unlrelated double post of this out of the other thread, to keep things "sorted".

1 Like