python - 了解两个 ISO 8061 时间之间的区别
问题描述
无法理解 ISO 8061 中两个时间戳之间的区别:
我有两个字符串:
alert_time
'2019-08-21T22:05:59.605Z'
current_time
'2019-08-21T22:06:58'
我更改了 alert_time 变量以匹配 current_time 的格式
alert_time = alert_time[:-5]
alert_time
'2019-08-21T22:05:59'
现在我想看看它们之间的区别
datetimeFormat = '%Y-%m-%dT%H:%M:%S'
diff = datetime.datetime.strptime(alert_time, datetimeFormat) - datetime.datetime.strptime(current_time, datetimeFormat)
diff
datetime.timedelta(-1, 86341)
那个输出是什么意思?我正在寻找能在几秒钟内告诉我差异的东西
解决方案
推荐阅读
- javascript - 有没有可能在 WebGlPointsLayer 上实现多过滤器
- r - 用值除以整列的平均值替换数据框中的值
- api-design - 除了枚举值之外,rest apis 是否应该返回枚举消息?
- r - 如何将 R 输出数据保存到文本文件
- git - 使用 LFS 从本地仓库克隆 Git
- c# - 将 KeyBinding 命令绑定到 WPF DatePicker (MVVM)
- ios - 为 iOS 构建时 cocoa-pods 库中的重复符号
- python - python日志记录中同一日志文件的多个处理程序
- c# - IEnumerable
与整数/长整数的协方差 - git - 为什么 git pull origin master 创建合并提交