如何获取Firestore时间戳之间的持续时间? [英] How to get duration between Firestore timestamp?
本文介绍了如何获取Firestore时间戳之间的持续时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Node.js Firebase云功能,并且每个都有2个带有Firestore时间戳对象的文档.
I am use Node.js Firebase cloud function and have 2 document each with Firestore timestamp object.
如何获取以分钟为单位的时间戳之间的持续时间?例如137分钟.
How to get duration between timestamp in minute? For example 137 minute.
推荐答案
Timestamp
具有有用的属性:seconds
.
因此,您可以编写:
(t1.seconds - t2.seconds) / 60
这篇关于如何获取Firestore时间戳之间的持续时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文