如何查找Ruby中两个Date对象之间的天数? [英] How can I find the number of days between two Date objects in Ruby?
本文介绍了如何查找Ruby中两个Date对象之间的天数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何找到两个Date对象之间的天数?
How can I find the number of days between two Date objects?
推荐答案
从结束日期减去开始日期:
Subtract the beginning date from the end date:
endDate - beginDate
这篇关于如何查找Ruby中两个Date对象之间的天数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文