【发布时间】:2021-04-25 18:20:15
【问题描述】:
在我的应用程序中,我有两个 UTC 时间戳,需要比较它们。我如何才能获得更大的时间戳?
var ts1=1611169043381; //UTC timestamp in string format
var ts2=1611184342102; //UTC timestamp in string format
比较后想知道哪个时间戳大于另一个
在 JSON 中,st1 是字符串格式
"st1": {
"value": "1611169043381",
"source": "CRM_UI",
"sourceId": "info@pearagon.com",
"updatedByUserId": 8966293,
}
【问题讨论】:
-
Math.max(ts1,ts2) -
ts1 > ts2- 如果为真,ts1更大
标签: javascript node.js time timestamp