3

What does dashes mean in ISO 8601 date and time format?

--0412
--1022T1410
---12

Is it current year and month, some "minimum" year or anything else?

If its a current year, does this means I can not represent it in DateTimeOffset object in .Net because it will set some specific year and month when parsing '---12' string?

IT Hit WebDAV
  • 5,652
  • 12
  • 61
  • 98

2 Answers2

3

In ISO 8601:1998 and ISO 8601:2000 they are known as truncated representations where each hyphens indicate omitted components.

--MMDD represents a specific day of the month in the implied year. Truncated representations where removed in ISO 8601:2004 because it introduced an ambiguity in truncated representations with implied century.

chansen
  • 2,446
  • 15
  • 20
  • Thank you Chansen. Hmmm... I did not know they are removed in ISO 8601:2004. vCard RFC 6350 (from August 2011) says "Truncated representation, as specified in [ISO.8601.2000], Sections 5.2.1.3 d), e), and f), is permitted.". – IT Hit WebDAV Dec 31 '13 at 12:05
  • @ITHitWebDAV RFC 6350 is probably constrained by [RFC 2425](http://tools.ietf.org/search/rfc2425#page-13) wich left a lot of interpretation to the implementor, RFC 2425 says "based on a subset of the definitions in ISO 8601 standard" without defining the actual subset. RFC 6350 refers to both ISO 8601:2000 and 8601:2004 where it makes sense and thus reduce the possibility for ambiguity. – chansen Dec 31 '13 at 18:03
0

"In certain application areas a double hyphen is used as a separator instead of a solidus.". (Notations like 2000--2002 were promoted by previous versions of the standard.)

The ISO 8601 standard does not specify whether a date or time (or date and time) designation refers to a singular point in time or a time period. In particular, a designation of a date can be used to refer to a full 24-hour day or a specific moment of time within it, probably by default the start of the day (00:00). Similarly, a time notation like 9:00 could refer to nine o'clock absolutely sharp or the period from 09:00 to 09:01 or anything else. When necessary, a specific agreement or verbal indication of the meaning can be given, or the most explicit notation with ISO 8601 could be used. For example, one could write 09:00:00 or 09:00:00/09:01:00 to distinguish between the two interpretations mentioned above.

Source

Also recommend you read the following:

Standard Date and Time Format Strings

gotnull
  • 26,454
  • 22
  • 137
  • 203