flet
flet copied to clipboard
Include client's time zone as part of `Page` object
Discussed in https://github.com/flet-dev/flet/discussions/4175
More about time zone in Flutter:
- https://stackoverflow.com/questions/13/determine-a-users-timezone
- https://api.dart.dev/stable/3.5.4/dart-core/DateTime/timeZoneOffset.html
We should pass two values from a dart client (which runs in the browser when app is a web app):
-
date.timeZoneName- string -
date.timeZoneOffset- Duration
On Python side we create Flet implementation of datetime.tzinfo class which requires offset, DST adjustment (not sure about that) and zone name.
Later on in a user code tzinfo can be used with datetime, e.g. datetime.datetime.now(tz)