Datetime Format
Closed this issue ยท 9 comments
The created
date format would be nice to have in a more standard way so that it is easier to present the time based on localization:
- "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
@hopeman15 hey Kyle!
Thanks for the report :)
Could you, please, take a look here (dev
API tag):
https://covidapp.herokuapp.com/swagger/
I am testing new API structure, which feels much better (in my opinion). I also changed updated
date format there, as you are expecting. ;)
@amureki Noice ๐ this is fun, really taking form ๐ sorry, I meant created
not updated
๐ but on both would be nice too ๐
@hopeman15
So, for example, I imagine response from world
endpoint would be like:
{
"created": "2020-03-09T23:03:09.796172+01:00",
"confirmed": 113584,
"deaths": 3996,
"recovered": 62496,
"regions_data": [
{
"region": "Mainland China",
"region_slug": "mainland-china",
"lat": 30.5928,
"long": 114.3055,
"confirmed": 80735,
"deaths": 3120,
"recovered": 58728,
"updated": "2020-02-21T06:03:04+01:00"
},
]
}
Is it the format you'd expect?
@hopeman15
So, for example, I imagine response fromworld
endpoint would be like:{ "created": "2020-03-10T21:09:09.829Z", "confirmed": 113584, "deaths": 3996, "recovered": 62496, "regions_data": [ { "region": "Mainland China", "region_slug": "mainland-china", "lat": 30.5928, "long": 114.3055, "confirmed": 80735, "deaths": 3120, "recovered": 58728, "updated": "2020-03-10T21:09:09.829Z" }, ] }
Is it the format you'd expect?
I was thinking more UTC -> 2020-03-10T21:09:09.829Z
then one can let the operating system convert the updated to any given local time, other than that, looking good ๐
@hopeman15 yup, that sounds better.
Please, check it out here:
https://covidapp.herokuapp.com/swagger/
https://covidapp.herokuapp.com/api/dev/world/
@amureki looks like the created date has a few too many milliseconds compared to the updated time format, so trim that bad boy down to two and we're solid ๐
Created: 2020-03-12T06:21:51.524572Z
Updated: 2020-03-11T18:52:03Z
@hopeman15 good catch. :) Fixed and deployed.
Do you have any other suggestions? Would that work for your app if I'd release it as v1
? Or you'll be still missing something?
Thanks, Kyle, it is there now! โจ