MS .NET does not support "24:00:00" for xs:time or xs:dateTime
The XML Schema standard allows both "00:00:00" and "24:00:00" as lexical representations for midnight. This easiest explanation is given by the XPath documentation:
For xs:time, 00:00:00 and 24:00:00 are alternate lexical forms for the same value, whose canonical representation is 00:00:00. For xs:dateTime, a time component 24:00:00 translates to 00:00:00 of the following day.
Altova and Xerces interpret "24:00:00" correctly, but MS .NET's System.Xml fails with an error. As it is widely used, we should probably avoid using "24:00:00".
With railML 2.5, we introduced the following documentation for the previously undocumented attributes of tTimeSpan, which is only used by IS:uptime:
-
from:The start time for the given mode. When referring to midnight at the beginning of the day, please use "00:00:00". -
until:The end time for the given mode. When referring to midnight at the end of the day, please use "24:00:00".
This distinction is only in the lexical representation, as xs:time("24:00:00") = xs:time("00:00:00").
Possible solutions
- Change the recommendation to use "24:00:00" to always use "00:00:00" for midnight.
- Specify that midnight in
fromshall always be interpreted as the beginning of the day and midnight inuntilas the end of the day. - Warn that "24:00:00" for any
xs:timeorxs:dateTimevalue is not compatible with MS .NET and should be avoided.