【发布时间】:2020-06-30 20:18:52
【问题描述】:
我有一些看起来像这样的 json....
[
{
"start": "20200629T202456Z",
"end": "20200629T211459Z",
"tags": [
"WPP",
"WPP review tasks, splashify popup",
"clients",
"work"
],
"annotation": "update rules, fix drush errors, create base wpp-splash module."
},
{
"start": "20200629T223000Z",
"end": "20200629T224641Z",
"tags": [
"WPP",
"WPP review tasks, splashify popup",
"clients",
"work"
]
},
]
我想显示小时:分钟的持续时间,而不是“开始”和“结束”时间。
时间格式可能有点不寻常(?),它来自 timewarrior。我想如果日期/时间存储在普通的 unix 时间戳中,jq 会更容易完成,但也许这仍然是可能的? jq可以像这样写输出
[
{
"time": "0:50:03",
"tags": [
"WPP",
"WPP review tasks, splashify popup",
"clients",
"work"
],
"annotation": "update rules, fix drush errors, create base wpp-splash module."
}
]
或类似的东西。
这可能吗?
【问题讨论】: