Editing Entry in Database causes datefield to go back one day

Editing Entry in Database causes datefield to go back one day

by Ellen Yarnell -
Number of replies: 1

We recently upgraded from Moodle 2.7 to 3.2.3, since the upgrade we have had a problem with the date field in a couple of our database activities.

Here's the sequence

  • The database has a absence date field, using date field type, where students record the date they will be absent and need a replacement.
  • The student enters in the day they will be absent, along with other details, and then saves the entry.
  • When the administrator opens up the database, by clicking the edit entry icon, to edit an individual entry the date field automatically reverts to the date before the date the student entered, e.g. August 21, 2017 becomes August 20, 2017.

How do we fix this so that the date field date doesn't change?

Thank you!

Average of ratings: -
In reply to Ellen Yarnell

Re: Editing Entry in Database causes datefield to go back one day

by William Lu -
Picture of Particularly helpful Moodlers

Hi Ellen,

I found the same problem 2 years ago. I think Moodle had it fixed since 3x. I've tested this on V3.1, V3.2, V3.3, no problem on my Mac computer anymore. I don't have a Windows PC for testing. Are you using PC or Mac?


To work around this bug, I created 3 dropdown menus instead. I found it is better than the Date field because you can have a limited year to select.