Skip to content
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

MoodleBox PHP timezone and OS timezone are not consistent #324

Closed
ralf-krause opened this issue Feb 22, 2024 · 5 comments
Closed

MoodleBox PHP timezone and OS timezone are not consistent #324

ralf-krause opened this issue Feb 22, 2024 · 5 comments
Assignees
Labels
Status: test passed Feature or fix is successfully tested Type: bug Something isn't working
Milestone

Comments

@ralf-krause
Copy link

The first time I saw the problem was when I setup the MoodleBox 4.6.0 to use an RTC.
Please look at https://discuss.moodlebox.net/d/247-using-a-real-time-clock-module-on-moodlebox/8
The date/time string in the MoodleBox dashboard is different to the computer time. Yes, I thought there could be a problem with my RTC settings.

Today I did a new test. I installed a fresh microSD card with the MoodleBox 4.6.0 image. I started the MoodleBox with the new image. The MoodleBox was connected to the router so the date/time string should be correct. Yes, the date/time string in the dashboard is different to the computer time again. In my addional test I connected via ssh to get the system date/time from the Terminal ... the system date/time is correct but not the string in the MoodleBox dashboard.

You can see my tests in in the following screenshot. There are the computer time, the terminal, and the MoodleBox dashboard.

Ralf

moodlebox-system-date-and-time

@ralf-krause ralf-krause changed the title Bug: The MoodleBox dashboard shows a wrong time Bug: The MoodleBox dashboard shows the wrong time Feb 22, 2024
@ralf-krause
Copy link
Author

I forgot to write ... I changed nothing with the MoodleBox 4.6.0 image. Everything comes out of the box.

@ralf-krause
Copy link
Author

I installed MoodleBox 4.5.1 on another microSD card to look at the same things in MoodleBox 4.5.1. In this MoodleBox version the dashboard shows the correct date/time string.

moodlebox-451-system-date-and-time

@martignoni
Copy link
Member

This is not really a bug, since one can (and should) set the correct default timezone for the MoodleBox under Moodle, via Site Administration > Location settings.

Beware that the date depends also from the timezone setting of each user, so if you've changed the admin user's timezone in the Moodle profile, the date displayed in the dashboard is updated accordingly.

Anyway, the default timezone for PHP (and Moodle) is currently "Europe/London", which is not consistent with the OS default timezone, that is "Europe/Zurich", so this should be fixed. Thank you for the report.

Sidenotes:

  • The change of behaviour between v4.5.1 and v4.6.0 is certainly due to PHP update to 8.2.
  • This has nothing to do with your RTC, since a RTC has to be on UTC time.

@martignoni martignoni self-assigned this Feb 22, 2024
@martignoni martignoni added the Type: bug Something isn't working label Feb 22, 2024
@martignoni martignoni changed the title Bug: The MoodleBox dashboard shows the wrong time MoodleBox PHP timezone and OS timezone are not consistent Feb 22, 2024
@martignoni
Copy link
Member

Also: this is not an issue with the MoodleBox plugin, but with MoodleBox itself. Moving to correct project.

@martignoni martignoni transferred this issue from moodlebox/moodle-tool_moodlebox Feb 22, 2024
martignoni added a commit that referenced this issue Feb 22, 2024
- PHP timezone should be in sync with OS timezone, for consistency.
- See issue #324.
martignoni added a commit that referenced this issue Feb 22, 2024
- PHP timezone should be in sync with OS timezone, for consistency.
- See issue #324.
@martignoni martignoni added the Status: test passed Feature or fix is successfully tested label Feb 22, 2024
@martignoni
Copy link
Member

Closing as fixed.

@martignoni martignoni added this to the 4.7.0 milestone Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: test passed Feature or fix is successfully tested Type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants