Date shown in 'Time selector' is shifted one day #6968
-
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Hi @iamsaswata The dates in Terria will be in your local timezone. Can you please confirm what timezone your in? Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hi @nf-s My timezone is Pacific Daylight Time (GMT-7) zone. |
Beta Was this translation helpful? Give feedback.
-
Hi @iamsaswata The times provided by your GeoServer are most likely in UTC, but Terria will render dates in your local timezone - this is the default behaviour for handling dates in web browsers. This is why you are seeing a different date between the date/time selector - and the If you want to display UTC times in the Terria UI - you can use the For example - if you put "dateFormat": "UTC:dd/mm/yyyy" Let me know how you go! Thanks 🙂 |
Beta Was this translation helpful? Give feedback.
-
This is an issue for all timezones which are behind UTC (and therefore all of the Americas). The solution identified above (using However, this is still an issue if you enable the WMS time filter tool by setting |
Beta Was this translation helpful? Give feedback.
-
Hi @JonDHo are you able to share your Terria JSON configuration with us? Then we can recreate the problem from our side. |
Beta Was this translation helpful? Give feedback.
-
Following on from the discussion on Slack, I believe that my issue is with datacube-ows, not Terria, but will link back here if anything is needed on this end. |
Beta Was this translation helpful? Give feedback.
-
I am going to convert this into a GitHub discussion - we can create more issues as needed if we come across anything |
Beta Was this translation helpful? Give feedback.
Hi @iamsaswata
The times provided by your GeoServer are most likely in UTC, but Terria will render dates in your local timezone - this is the default behaviour for handling dates in web browsers. This is why you are seeing a different date between the date/time selector - and the
time
value sent to your GeoServer.If you want to display UTC times in the Terria UI - you can use the
dateFormat
configuration option.For example - if you put
UTC:
before your format string, then the date will be shown in UTC instead of your local timezoneLet me know how you go!
Thanks 🙂