在下面的json响应中,createdDate和updatedDate的日期格式是什么?我不知道如何反向工作以找到api用于日期的格式。我在文档中找不到任何地方。
{
"size": 1,
"limit": 25,
"isLastPage": true,
"values": [
{
"id": 101,
"version": 1,
"title": "Talking Nerdy",
"description": "It’s a kludge, but put the tuple from the database in the cache.",
"state": "OPEN",
"open": true,
"closed": false,
"createdDate": 1359075920,
"updatedDate": 1359085920,
"fromRef": {
"id": "refs/heads/feature-ABC-123",
"repository": {
"slug": "my-repo",
"name": null,
"project": {
"key": "PRJ"
}
}
},
"toRef": {
"id": "refs/heads/master",
"repository": {
"slug": "my-repo",
"name": null,
"project": {
"key": "PRJ"
}
}
},
"locked": false,
"author": {
"user": {
"name": "tom",
"emailAddress": "tom@example.com",
"id": 115026,
"displayName": "Tom",
"active": true,
"slug": "tom",
"type": "NORMAL"
},
"role": "AUTHOR",
"approved": true
},
"reviewers": [
{
"user": {
"name": "jcitizen",
"emailAddress": "jane@example.com",
"id": 101,
"displayName": "Jane Citizen",
"active": true,
"slug": "jcitizen",
"type": "NORMAL"
},
"role": "REVIEWER",
"approved": true
}
],
"participants": [
{
"user": {
"name": "dick",
"emailAddress": "dick@example.com",
"id": 3083181,
"displayName": "Dick",
"active": true,
"slug": "dick",
"type": "NORMAL"
},
"role": "PARTICIPANT",
"approved": false
},
{
"user": {
"name": "harry",
"emailAddress": "harry@example.com",
"id": 99049120,
"displayName": "Harry",
"active": true,
"slug": "harry",
"type": "NORMAL"
},
"role": "PARTICIPANT",
"approved": true
}
],
"link": {
"url": "http://link/to/pullrequest",
"rel": "self"
},
"links": {
"self": [
{
"href": "http://link/to/pullrequest"
}
]
}
}
],
"start": 0
}
答案 0 :(得分:1)
请注意,在我的情况下,这是UNIX时间戳,但是我必须删除三个结尾的零。例如。数据如下:
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({
secret: params['s'],
token: params['t'],
domain: params['domain'],
webSocket: false // defaults to true
}),
如果将其解释为UNIX时间戳,则应为09/12/51265 @ 4:16 am(UTC)。
通过删除三个尾随零,我得到1555621993,这是正确的时间04/18/2019 @ 9:13 pm(UTC)
您的里程可能会有所不同,但这对我来说是一个关键发现:)
答案 1 :(得分:0)
它看起来像一个UNIX时间戳。 https://en.wikipedia.org/wiki/Unix_time