Skip to content

如何计算两个时间字段的差值 #4210

Discussion options

You must be logged in to vote

新建两个字段,字段类型为日期。然后选择显示时间,里面可以勾选12小时制或24小时制,我是勾选了24小时制。再然后在公式里,选择第二个Formula.js,然后用(变量1-变量2)/60000就可以得到相差的数值了,除以60000得到的是分钟。变量1和变量2在旁边里点击展示。

如果只是时间类型,是无法显示出来的。如果日期类型没有勾选显示时间,那么大概率是计算相差的天数。基本上是这样。

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dongrentianyu
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by dongrentianyu
Comment options

You must be logged in to vote
1 reply
@dongrentianyu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants