-
简单处理 ISO8601 时间间隔的库:time-interval
资源介绍
时间间隔
您知道 ISO8601 定义了时间间隔标准吗?
在此处了解所有相关信息: :
# A one month period
interval = TimeInterval . parse "2007-03-01T00:00:00Z/P1M"
interval . start_time # => 2007-03-01 00:00:00 UTC
interval . end_time # => 2007-04-01 00:00:00 UTC
# A period defined by two time points
interval = TimeInterval . parse "2007-03-01T00:00:00Z/2007-09-01T00:00:00Z"
interval . start_time # => 2007-03-01 00:00:00 UTC
interv