Closed mralext20 closed 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:
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 .
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"}
useful for more easily knowing how old the data received is.