Maybe related to these: Kirby messes with "time", Date-field doesn't save local time
I think this is a bug. It looks very bug-like - lots of little legs. But it’s kinda confusing so maybe I’m just doing something wrong.
Here’s what happens when I use the Date field in my blueprint:
- The user picks a date and saves. Let’s say 2019-08-29
- Prior to sending it to the server the browser converts it to UTC time. It assumes you meant midnight on whatever day you picked, then subtracts the timezone offset. So if you are in a -5 timezone like me, it sends 2019-08-29T05:00:00.00Z to the server. (Note that in my case the timezone offset is negative, so the result of subtracting it increases the time.)
- The server accepts the offset date, truncates the timestamp portion and saves it to the .txt file.
- Later the server reads the .txt file, assumes UTC timezone, attaches a midnight time, and sends it off to the browser like this: 2019-08-29T00:00:00.00+00:00
- The browser accepts the date, notices that it is in UTC time and adds the local timezone offset. In my case -5, which converts the date to 2019-08-28T19:00:00.00
- The date field does not display the time portion, only showing 2019-08-28 to the user when they originally entered 2019-08-29
The topics I linked above suggest setting PHP’s timezone. Correct me if I’m wrong, but I don’t think that will work if users are in multiple timezones.