首页 > 解决方案 > Thinger.IO response timestamp (1486047553711) string to Date time

问题描述

I am using thinger.io for my project.

I send request to fetch registered devices in thinger.IO and its details by using following URL

http://{myip}/v1/users/username/devices?authorization={mytoken}

and i get the following response

[
 {
  "device":"nodemcu",
  "description":"NodeMCU With ESP8266",
  "connection":{
  "active":true,
  "ts":1486047553711
 }
}
]

I want to convert the ts "1486047553711" to proper date time by using Javascript or with anything possible.

As I am beginner in thinger.io. Its getting hard for me to understand their document.

Any help.

标签: javascriptc#c

解决方案


您可以通过将其传递给日期构造函数将其转换为正确的日期格式: new Date(1486047553711); 回复是:2017 年 2 月 2 日星期四 20:29:13 GMT+0530(印度标准时间)


推荐阅读