Recommended date format for REST GET API

前端 未结 5 1301
一向
一向 2020-12-12 16:13

What\'s the recommended timestamp format for a REST GET API like this:

http://api.example.com/start_date/{timestamp}

I think the actual dat

5条回答
  •  难免孤独
    2020-12-12 16:42

    Check this article for the 5 laws of API dates and times HERE:

    • Law #1: Use ISO-8601 for your dates
    • Law #2: Accept any timezone
    • Law #3: Store it in UTC
    • Law #4: Return it in UTC
    • Law #5: Don’t use time if you don’t need it

    More info in the docs.

提交回复
热议问题