-
-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong time on comments #2455
Comments
I just tested with 3.0.7 and the issue is there. Container time is set to UTC. I added a comment with the user set to Americas/Los_Angeles time, then changed to Americas/New_York and added another comment, see below. The entries date should read "2024-04-03 14:15:24" and "2024-04-03 14:17:55" but are offset by the timezone of the user.
It is caused by date_default_timezone_set at https://github.com/Leantime/leantime/blob/master/app/Core/Middleware/Localization.php#L53, it will cause calls to date() to be offset by the timezone. A solution would be to use gmdate instead of date at https://github.com/Leantime/leantime/blob/master/app/Domain/Comments/Repositories/Comments.php#L206. The same problem exists for other repositories (e.g. Wiki). |
Fixed in 3.1.2 |
What set up are you using
Describe the bug
All container has timezone UTC, for user setting the timezone is set to Europe/Berlin (+2 Hours). When adding new comment it set wrong time to +4 hours (instead of only +2 hours). After checking entry in MYSQL we saw time in DB ( +2 hours). Therefore I think it adding 2 hours twice -> once when update and another one when shows...
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Correct time on comments.
Leantime Version
Leantime 3.1.1
Server
NGINX
PHP / MySQL Version
myslq 8.0
Additional context
The leantime is build on docker-compose.yaml file from DOCu
The text was updated successfully, but these errors were encountered: