# Time shift problem publishing SolCast forecast in JSON

**URL:** <https://community.openenergymonitor.org/t/time-shift-problem-publishing-solcast-forecast-in-json/26500>\
**Category:** Emoncms\
**Tags:** mqtt, json, emonpi\
**Created:** [31 July 2024 17:29 UTC](https://community.openenergymonitor.org/t/time-shift-problem-publishing-solcast-forecast-in-json/26500 "2024-07-31T17:29:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [1 August 2024 20:57 UTC](https://community.openenergymonitor.org/t/time-shift-problem-publishing-solcast-forecast-in-json/26500/2 "2024-08-01T20:57:24Z")

</div>

> [@Titof](#):
>
> I wrote a python script

> [@Titof](#):
>
> Of course the timestamp of the SolCast JSON is in UTC, with the Z at the end.

Beware, Python treats a timestamp with a Z in it as local time _not_ UTC.

> [@Treating of time in Emoncms - UTC or BST](https://community.openenergymonitor.org/t/treating-of-time-in-emoncms-utc-or-bst/14365/10):
>
> Not processing Z might still be a bug is a feature [Issue 35829: datetime: parse "Z" timezone suffix in fromisoformat() - Python tracker](https://bugs.python.org/issue35829). You need to test it yourself. Potentially simply replace the Z for +00:00 in the string first. [edit] datetime.fromisoformat(my\_date.replace('Z', '+00:00')) [edit Nov 2023] It occurs to me this will create erroneous results if DST is in effect. I think the Z should just be removed so the time is assumed to be local time when converted.

---

_[View the full topic](https://community.openenergymonitor.org/t/time-shift-problem-publishing-solcast-forecast-in-json/26500)._
