Hi, I'm using Builder to generate forms for my models. I am saving a record with a field which is type of date, when saved, the saved date should be the same with what I've inputted.
After refreshing the page, the field shows a date one day lesser than what I've inputted. E.g., my input is January 26, 2018, after save and refresh, the field will display January 25, 2018.
Just create a model with a date field, choose a date, save, refresh, see that the date saved is one day lesser than what you've expected.
// app.php
'timezone' => 'UTC',
Background Preference Timezone: (UTC +08:00) Asia/Manila
October build: 431
That's because October automatically converts the date from the application timezone to the backend timezone on display; and also converts the date from the backend timezone to the application timezone on saving. To prevent this behaviour (i.e. store and display the dates exactly as entered, set the ignoreTimezone option to true on the datepicker and/or the datetime column. See http://octobercms.com/docs/backend/forms#widget-datepicker and http://octobercms.com/docs/backend/lists#column-datetime
Most helpful comment
That's because October automatically converts the date from the application timezone to the backend timezone on display; and also converts the date from the backend timezone to the application timezone on saving. To prevent this behaviour (i.e. store and display the dates exactly as entered, set the
ignoreTimezoneoption to true on the datepicker and/or the datetime column. See http://octobercms.com/docs/backend/forms#widget-datepicker and http://octobercms.com/docs/backend/lists#column-datetime