REST Service that converts a Unixtimestamp to a DateTime and vice versa.
- Built using Linx 6.4.3 (https://linx.software)
- Download and install the Linx Designer https://linx.software/download-linx/
- Pull the "Linx 6 Solution" folder from the repo
- Open the UnixTimeService.solution file in the Linx 6 Designer
- Click "Debug" and "Start" to run the RESTHost service locally
- Browse to any of the URL's from the "GET Methods" section below
- Use Postman or similar to post the Body Json to the related URL in the "POST Methods" below
Unix Timestamp to UTC DateTime (yyyy-MM-dd HH:mm:ss) with string response
Request Example: http://localhost:5678/UnixTime/fromunix?timestamp=1549892280
Response: "2019-02-11 13:38:00"
Unix Timestamp to UTC DateTime (yyyy-MM-dd HH:mm:ss) with JSON object response
Request Example: http://localhost:5678/UnixTime/fromunixtimestamp?unixtimestamp=1549892280
Response: {"Datetime":"2019-02-11 13:38:00"}
DateTime (multiple formats) to Unix Timestamp with string response
Request Example: http://localhost:5678/UnixTime/tounix?date=2019/02/11 13:38:00
Response: "1549892280"
Current DateTime (multiple formats) to Unix Timestamp with string response
Request Example: http://localhost:5678/UnixTime/tounix?date=now
Response: Current UnixTimeStamp as integer
DateTime (multiple formats allowed) to Unix Timestamp with JSON object response
Request Example: http://localhost:5678/UnixTime/tounixtimestamp?datetime=2019/02/11 13:38:00
Response: {"UnixTimeStamp":"1549892280"}
Current DateTime as UnixTimestamp
Request Example: http://localhost:5678/UnixTime/tounixtimestamp?datetime=now
Response: {"UnixTimeStamp":"1549971762"}
Unix Timestamp to DateTime with timezone (yyyy-MM-dd'T'HH:mm:ssXXX)
http://localhost:5678/UnixTime/fromunixtimestamp
Body Example 1: {"UnixTimeStamp": "1589772280","Timezone": ""}
Response: {"Datetime":"2020-05-18T03:24:40Z"}
Body Example 2: {"UnixTimeStamp": "1589772280","Timezone": "+3"}
Response: {"Datetime":"2020-05-18T06:24:40+03:00"}
http://localhost:5678/UnixTime/tounixtimestamp
Body Example 1: {"Datetime": "2019/02/11 13:38:00"}
Response: {"UnixTimeStamp":"1549892280"}
Body Example 2: {"Datetime": "2019-03-13 16:00:00"}
Response: {"UnixTimeStamp":"1552492800"}
http://localhost:5678/UnixTime/fromunixtimestamp?unixtimestamp=-99999999991
Response: {"Error":"Operation: Message"}
Publishing this service requires a Linx Server