Timezone Fix for Datetime Metafields
Has anyone else noticed that a metafield of type datetime, when used as a dynamic data source, renders in the wrong timezone?
ENGAGE QUIRKS MODE
IF a Metafield of type DATETIME is used as a Dynamic Data Source
AND the DATETIME has a Timezone offset
AND when that value is rendered as HTML
THEN the displayed Time will be rendered in ? UTC, not the store's local Timezone.
But don't worry - there's a workaround: capture the metafield as a string and manually format the date
﹛% capture start_date %﹜
﹛﹛ product.metafields.rbb.event_start_time ﹜﹜
﹛% endcapture %﹜
﹛% assign nice_start = start_date | date: '%b %d, %Y, %-I:%M %P' %﹜
Thanks to Gary Thompson for the excellent tip!