We're using date ranges for some events in an application. We're finding that when we use the date value and end_value independent of one another then the timezone is incorrect.
For example, inside a view, we're experimenting with our values using twig.
{{ dump(field_open_close_date) }}
Give us this
field_open_close_date' =>
object(Drupal\Core\Render\Markup)[7546]
protected 'string' => string '2020-02-10T20:00:39 - 2020-03-18T14:00:00' (length=41)
'field_open_close_date__value' => string '2020-02-10T09:00:39' (length=19)
'field_open_close_date__end_value' => string '2020-03-18T03:00:00' (length=19)
The full date range is correct. Focussing on the end date, 2020-03-18T14:00:00 is correct as we are in +11 right now with daylight saving. But, when looking at the end_value, you can see a +0 date time of 2020-03-18T03:00:00.
I can't seem to (cleanly) fix these in a view and I really don't want to fix them in each view and then in each other location because all other non-views and non-twig examples of this field has the same result. Unless I use the entire range, it wont be correct.
Note that in future I'll just use 2 date fields but we have too much data in the db to change this now.