ks888 / LambStatus

[Maintenance mode] Serverless Status Page System
https://lambstatus.github.io
Apache License 2.0
1.3k stars 119 forks source link

ISO 8601 formatted dates with timezone offsets are interpreted as being Z formatted #112

Closed poswald closed 6 years ago

poswald commented 6 years ago

Discovered while looking into #103, the API doesn't respect non-normalized timezones and instead assumes Z format:

$  curl -X POST "https://<endpoint>.cloudfront.net/api/v0/metrics/data" \
>   -d '{
>     "<metric_id>": [
>       {"timestamp": "2018-04-09T01:00:00+09:00", "value": 100}
>     ]
>   }' \
>   -H "x-api-key: <api_key>" -H "Content-Type: application/json"

{"<metric_id>":[{"timestamp":"2018-04-09T01:00:00.000Z","value":100}]}

The timestamp returned by the API is in Z format but is now shifted 9 hours from when it should have been.

ks888 commented 6 years ago

Oops, that should be fixed! Thank you for pointing it out!