Is it possible to represent and open-ended time interval with ISO 8601?

拜拜、爱过 提交于 2019-12-23 19:42:50

问题


ISO 8601 includes a few ways to represent time intervals:

  • start/end
  • start/duration
  • duration/end
  • duration

For example, 1990/1999 is an interval including all of the 1990s.

But what if I have an open-ended range of dates, e.g. "before 1970" or "after 1900"? Can these be represented with ISO 8601?


回答1:


Short answer related to current state:

No, it is up to you how you interprete the end marker of an interval.

The actual valid ISO-8601-version is silent about open or closed interval boundaries. And its appendix containing examples does not mention infinite intervals at all. There is no word about how to express such infinite boundaries as text.

I have myself modelled such boundaries in my library written in Java, however, this is clearly an extension and not a current feature of ISO-8601.

Future version of ISO-8601:

A new version will come. The draft of the second part suggests for example in its section 4.4 different representations like "../2018-05-14" where the double dot would be interpreted as open (=missing) start.

So in the future, yes, you can probably express infinite interval boundaries but I still miss any word about open versus closed boundaries (open=exclusive, closed=inclusive).

Another question is if there will be any receiver being capable of processing such representations. You have probably to wait a rather long time.



来源:https://stackoverflow.com/questions/48696238/is-it-possible-to-represent-and-open-ended-time-interval-with-iso-8601

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!