osmlab / yalcha

A Go implementation of openstreetmap-cgimap
4 stars 5 forks source link

Timestamps: incorrect timezone and format #11

Closed mmd-osm closed 6 years ago

mmd-osm commented 6 years ago

Timestamps always have to be returned in UTC-0, with a "Z" at the end. Currently, yalcha returns times in UTC+03:00 timezone, without a time zone indicator:

https://vheirh41ic.execute-api.us-west-2.amazonaws.com/development/api/0.6/node/21265449/history

timestamp="2017-11-29T13:16:22"

https://api.openstreetmap.org/api/0.6/node/21265449/history

timestamp="2017-11-29T10:16:22Z"

paulmach commented 6 years ago

yes, a 'Z' needs to added to this constant https://github.com/osmlab/yalcha/blob/7bea019320fb651e15fe71107ddb6c3eae92605f/osm/helpers.go#L10

and probably some .UTC() added to the timestamps after they are loaded from the db. But it might be easier to just run the server in UTC.

pnorman commented 6 years ago

You probably want to set your timezone to UTC when connecting to postgres