jq fromdate "不匹配格式 "%Y-%m-%dT%H:%M:%SZ"

问题描述

我在下面有一个示例 json 输出,let newText = "My new trade mark is MELLON<sup style=\"font-size:6px\">TM</sup> Corporation" let data = newText.data(using: .utf8) let attrString = try? NSMutableAttributedString( data: data ?? Data(),options: [ NSAttributedString.DocumentReadingOptionKey.documentType: NSAttributedString.DocumentType.html,NSAttributedString.DocumentReadingOptionKey.characterEncoding: String.Encoding.utf8.rawValue,],documentAttributes: nil ) let mainAttributedText = NSMutableAttributedString() mainAttributedText.append(attrString ?? NSMutableAttributedString()) label.textStorage?.append(mainAttributedText) 值是 AWS 在运行 CLI 命令时输出它的值,因此我无法控制日期的格式。

LastAccessedDate

当尝试运行 jq 命令以使用 { "MyList": [ { "Name": "MyName1","LastAccessedDate": "2021-06-29T02:00:00+02:00" } ] } 进行选择时:

fromdate

然后我收到错误消息: cat output.json | jq '.[] | .[] | select ( .LastAccessedDate | fromdate > "2021-01-01T02:00:00+02:00")'

有什么办法可以让我使用 jq 来过滤输出吗? 甚至希望能解释一下可能出错的地方,以便我能够理解未来的用例。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)