Search code examples
datetimecalendariso8601

ISO 8601 DateTime representation


Is this a valid ISO 8601 representation of DateTime?

20170704T09:30:00+0530

i.e. whether a combination of both the basic and extended formats can be used? Or should it only be either of these:

20170704T093000+0530
2017-07-04T09:30:00+05:30


Solution

  • In Wikipedia, it says that a combined date and time representation can be in basic or extended format, but both date and time must use the same format.

    In ISO 8601, there's no mention of a mixed representation as well - take a look the examples in section 4.3.2. Although I couldn't find an explicit statement about mixing formats, it seems to me that you can't mix basic and extended formats in the same representation.

    That being said, I would say that a format like 20170704T09:30:00+0530 is not valid in ISO 8601.