avwx-rest/avwx-api

[Feature Request] Age indicator on METAR reports

mralext20 opened this issue · 4 comments

useful for more easily knowing how old the data received is.

JanC commented

Use the Time property to calculate the date:"Time": "050551Z", Once you have a date, it’s easy to get how old the metar is.

Here is how I parse it in Swift:

https://github.com/JanC/AVWXKit/blob/ae7d98f87401f70e30302b8bf0433ebab9f24616/AVWXKit/Models/MetarDate.swift#L20-L36

A pull request was made to AVWX-Engine which added this functionality to the core, but it has not been implemented in the client or on the API yet. I agree that this should be added, and it will be developed from the bottom and make its way into the API.

This functionality has been added and is currently available on the preview endpoints:

https://avwx.rest/api/preview/metar/KJFK

"time":{"dt":"Fri, 07 Sep 2018 13:51:00 GMT","repr":"071351Z"}