You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question about how Taipy manages date and time. I see that Gui().run has timezone parameter, that defaults to client.
When I instantiate a variable with datetime.datetime.now(), I think this uses the server's local datetime.
What I observe by playing around with it, is that when a date is modified from a date visual element, that date is stored in GMT, but is displayed, in the date element, in the selected timezone.
I see 2 potential problems:
1- The timezone that I use to initialize the values is not GMT (unless the server is in a GMT zone). So this can lead to inconsistencies.
2- If I display the date in a text() element, I get the GMT date, but the date element shows the timezone I selected within run().
Date and time is always a painful thing, so I don't know if this is a bug, or if I'm being too maniac. This is not a technical bug, it would be a malfunction at most.
Expected Behavior
Time zones should be consistent acoss visual elements, and across time.
If Taipy uses GMT datetimes, values should always e in GMT, even if they are initialized before the run() (I think that is one of the problems, but I'm not 100% sure).
Steps to Reproduce Issue
This code helps to reproduce the issue, but you need to interact to data element to see it better:
importdatetimeasdtimporttaipy.gui.builderastgbfromtaipyimportGuiwithtgb.Page() aspage:
tgb.text("# Date and times", mode="md")
tgb.text("{str(just_a_date)}")
tgb.date("{just_a_date}", with_time=True)
if__name__=="__main__":
just_a_date=dt.datetime.now()
print(f"Now it's: {just_a_date}")
gui=Gui(page=page)
gui.run(
# time_zone="Indian/Maldives", # for example - a different timezone for me
)
Runtime Environment
Windows 10, I used Python 12 within Anaconda, Taipy develop
Browsers
Brave
OS
Windows
Version of Taipy
4.0.0
Acceptance Criteria
A unit test reproducing the bug is added.
Any new code is covered by a unit tested.
Check code coverage is at least 90%.
The bug reporter validated the fix.
Related issue(s) in taipy-doc are created for documentation and Release Notes are updated.
What went wrong? 🤔
I have a question about how Taipy manages date and time. I see that Gui().run has timezone parameter, that defaults to client.
When I instantiate a variable with datetime.datetime.now(), I think this uses the server's local datetime.
What I observe by playing around with it, is that when a date is modified from a date visual element, that date is stored in GMT, but is displayed, in the date element, in the selected timezone.
I see 2 potential problems:
1- The timezone that I use to initialize the values is not GMT (unless the server is in a GMT zone). So this can lead to inconsistencies.
2- If I display the date in a text() element, I get the GMT date, but the date element shows the timezone I selected within run().
Date and time is always a painful thing, so I don't know if this is a bug, or if I'm being too maniac. This is not a technical bug, it would be a malfunction at most.
Expected Behavior
Time zones should be consistent acoss visual elements, and across time.
If Taipy uses GMT datetimes, values should always e in GMT, even if they are initialized before the run() (I think that is one of the problems, but I'm not 100% sure).
Steps to Reproduce Issue
This code helps to reproduce the issue, but you need to interact to data element to see it better:
Runtime Environment
Windows 10, I used Python 12 within Anaconda, Taipy develop
Browsers
Brave
OS
Windows
Version of Taipy
4.0.0
Acceptance Criteria
Code of Conduct
The text was updated successfully, but these errors were encountered: