Unix Timestamp converter REST API

Convert Unix Timestamps to DateTime objects and DateTime objects to Unix Timestamps


GET Methods

Unix Timestamp to UTC DateTime (yyyy-MM-dd HH:mm:ss)

https://ayu232.linx.twenty57.net:8081/UnixTime/fromunixtimestamp?unixtimestamp=1549892280
Response:
{"Datetime":"2019-02-11 13:38:00"}

DateTime (multiple formats) to Unix Timestamp

https://ayu232.linx.twenty57.net:8081/UnixTime/tounixtimestamp?datetime=2019/02/11 13:38:00
Response:
{"UnixTimeStamp":"1549892280"}

Get current UTC DateTime as Unix Timestamp

https://ayu232.linx.twenty57.net:8081/UnixTime/tounixtimestamp?datetime=now
Response:
{"UnixTimeStamp":"1549971762"}

POST Methods

Unix Timestamp to DateTime with timezone (yyyy-MM-dd'T'HH:mm:ssXXX)

https://ayu232.linx.twenty57.net:8081/UnixTime/fromunixtimestamp
---------------
Body:
{"UnixTimeStamp": "1589772280","Timezone": ""}
Response:
{"Datetime": "2020-05-18T06:24:40Z"}
---------------
Body:
{"UnixTimeStamp": "1589772280","Timezone": "+3"}
Response:
{"Datetime": "2020-05-18T06:24:40+03:00"}

DateTime (multiple formats) to Unix Timestamp

https://ayu232.linx.twenty57.net:8081/UnixTime/tounixtimestamp
---------------
Body:
{"Datetime": "2019/02/11 13:38:00"}
Response:
{"UnixTimeStamp":"1549892280"}
---------------
Body:
{"Datetime": "2019-03-07 16:00:00"}
Response:
{"UnixTimeStamp":"1549892280"}

Errors

https://ayu232.linx.twenty57.net:8081/UnixTime/fromunixtimestamp?unixtimestamp=-99999999991
Response:
{"Error":"Fromunixtimestamp.FromUnixTimestamp: The added or subtracted value results in an un-representable DateTime.\r\nParameter name: value"}

This WebService was built using Linx (https://linx.software), a rapid development and API hosting platform. This WebService is hosted on a Linx cloud server.

License