所以我有一堆unix時間戳值(以毫秒爲單位)的數據。像這樣:jq日期和unix時間戳
{
"id": "f6922fd5-4f97-4113-820e-b45eba0ae236",
"published_at": 1461624333859,
"tracking_id": "a85d5ed5-5efa-461b-aae0-beb2098c0ff7",
}, {
"id": "835d412f-5162-440c-937b-7276f22c4eb9",
"published_at": 1461625249934,
"tracking_id": "86472ba2-ce5f-400f-b42a-5a0ac155c42c",
}, {
"id": "bc2efcac-67a0-4855-856a-f31ce5e4618e",
"published_at": 1461625253393,
"tracking_id": "c005398f-07f8-4a37-b96d-9ab019d586c2",
}
而且我們經常需要搜索某個日期內的行。是否有可能用jq查詢,提供可讀的日期2016-04-25
。另外我想知道是否可以用其他方式使jq在人類可讀形式中顯示published_at
值?
例如工作的:
$ echo 1461624333 | jq 'todate'
"2016-04-25T22:45:33Z"
儘管它必須在幾秒鐘內,不毫秒
很好的答案。我最終使用這個我的時間字段: 'jq'.features []。properties.Time | =(。/ 1000 | strftime(「%Y-%m-%d%H:%M UTC」))'' ' –