avwx-rest/avwx-api

TAF - Different time formats

pejeio opened this issue · 1 comments

Expectation

start_time.dt and end_time.dt is always formatted in the correct ISO 8601 format

Result

The format differs from location to location.

EBBR

https://avwx.rest/api/taf/EBBR

Raw TAF: EBBR 050501Z 0506/0612 06011KT CAVOK

"start_time": {
  "repr": "0506",
  "dt": "2020-05-05T06:00:00+00:00Z"
}

ELLX

https://avwx.rest/api/taf/ELLX

Raw TAF: ELLX 050500Z 0506/0612 04010KT CAVOK

"start_time": {
  "repr": "0506",
  "dt": "2020-05-05T06:00:00Z"
}

It becomes especially difficult when this time has to be parsed for different weather stations. Tools like Moment.js fail.

Furthermore, the notation for EBBR does not appear to be correct. The letter "Z" should never be added when using "+00:00".

Schermafbeelding 2020-05-05 om 08 20 11

I will need to add some more tests in the core library to figure out what is causing some date time objects to be created without a timezone, but I've made a change to the JSON formatter that should fix this problem's symptom for the end-user.

avwx-rest/avwx-api-core@779cffd