avwx-rest / avwx-api

REST API for parsing aviation weather data
https://avwx.rest
MIT License
71 stars 89 forks source link

[Feature Request] Age indicator on METAR reports #9

Closed mralext20 closed 6 years ago

mralext20 commented 6 years ago

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

JanC commented 6 years ago

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

mralext20 commented 6 years ago

Unfortunately, the Time property does not include the month or year, making it non trivial around end of month or end of year calculations.

On Sun, Mar 4, 2018, 9:43 PM Jan Chaloupecky notifications@github.com wrote:

Use the Time property to calculate the date

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/flyinactor91/AVWX-API/issues/9#issuecomment-370324545, or mute the thread https://github.com/notifications/unsubscribe-auth/AD1Ipzqaj5sleKhaf2BdMiJvEfxoDej3ks5tbN6mgaJpZM4Sbset .

devdupont commented 6 years ago

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.

devdupont commented 6 years ago

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"}