javascript - 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.
解决方案
您可以通过将其传递给日期构造函数将其转换为正确的日期格式: new Date(1486047553711); 回复是:2017 年 2 月 2 日星期四 20:29:13 GMT+0530(印度标准时间)
推荐阅读
- python - ImportError:无法从“google.cloud”(未知位置)导入名称“bigquery_storage_v1beta1”
- ios - UITableView 显示动画
- json - 加载包含片段的 JSON 模式
- typescript - 使用等待/异步时,TypeScript 中 Axios 的返回类型不正确
- javascript - 在 React 中添加外部 JavaScript 文件时出错
- c# - How do I get a value associated with a user model class property for login redirection with access token?
- c# - Attributes added by custom ModelMetadataProvider are not being considered in model-binding
- outlook - 如何在 Outlook 2016 和 2013 中删除额外的、不需要的填充?
- r - ggplot2 使用 ..count.. 来控制 geom_point 的大小
- javascript - React 和 laravel 混合:找不到模块'@babel/preset-react'