Anvil Community Forum

Server-side anvil.tz.tzlocal

There does seem to be a problem with anvil.tx.tzlocal() on the server side.

Though it works fine on machines that do not have DST rule, it always returns the local DST on machines that support DST. Won’t be a problem with Anvil’s servers, but a runtime server might encounter some difficulties.

[Moved to bug reports]

Hi @rdsteed,

Thanks for reporting this - please could you elaborate a little on the actual issue you’re seeing? We would like to make sure it’s fixed!

Hi @rdsteed,

In fact, we have worked out and fixed the issue, so anvil.tz.tzlocal will correctly report local time on the server with the next release of the App Server. Thanks for spotting this!

2 Likes

@daviesian Sorry for the delayed reply, was not on the forum for a couple days. Glad to hear you got it fixed. But I will elaborate on why I actually saw the issue.

I am working on some code that must handle daylight saving transitions correctly, so I was looking at Anvil’s TZ support. I spotted the bug when I was doing a code review of downlink/python/anvil/tz.py

Incidentally, last September, Skulpt fixed a bug with how the time module reported time.daylight . Don’t know if this has any other side effects in Anvil’z client code.

2 Likes