在日期范围内获取所有日期
如果我有一个给定的日期范围(datefrom
和dateTo
),如何将所有日期在日期范围内获取?
If I have a given date range (DateFrom
and DateTo
), how can I get all the dates within the date range?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
按照如何将天和小时添加到日期时间变量?您只使用
dateutils.incsday()
。示例:As per How to add days and hours to a date-time variable? you just use
DateUtils.IncDay()
. Example:tdate
或tdateTime
值的整数部分是一天的数字(自1899-12-30)。使用此信息在日期范围内的所有日期迭代都可以如下所示:
The integer part of a
TDate
orTDateTime
value is the day number ( the number of days that have passed since1899-12-30). Using this information an iteration for all dates within a date range can look like this: