ISO 8601 midnight

  • Thread starter Thread starter bill tie
  • Start date Start date
Hello,
How is midnight represented in ISO 8601 format?

Although this isn't a purely C# question, here goes. In the ISO 8601 format,
midnight can be done in two ways, either as "00:00:00" or "24:00:00". From
the specification:

-------------------------------
4.2.3 Midnight

The complete representations in basic and extended format for midnight, in
accordance with 4.2.2, shall be
expressed in either of the two following ways:

Basic format Extended format
a) 000000 00:00:00 (the beginning of a calendar day)
b) 240000 24:00:00 (the end of a calendar day)
....

NOTE 2: The end of one calendar day [24:00] coincides with [00:00] at the
start of the next calendar day, e.g. [24:00] on 12 April 1985 is the same as
[00:00] on 13 April 1985. If there is no association with a date or a time
interval both a) and b) represent the same local time in the 24-hour
timekeeping system.
-------------------------------

A fellow countryman has a summary page about the format, including a direct
link to the ISO 8601 specification in PDF format:

http://www.cs.tut.fi/~jkorpela/iso8601.html

--
Regards,

Mr. Jani Järvinen
C# MVP
Vantaa, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 
Jani said:
Hello,
How is midnight represented in ISO 8601 format?

Although this isn't a purely C# question, here goes. In the ISO 8601 format,
midnight can be done in two ways, either as "00:00:00" or "24:00:00". From
the specification:

-------------------------------
4.2.3 Midnight

The complete representations in basic and extended format for midnight, in
accordance with 4.2.2, shall be
expressed in either of the two following ways:

Basic format Extended format
a) 000000 00:00:00 (the beginning of a calendar day)
b) 240000 24:00:00 (the end of a calendar day)
...

NOTE 2: The end of one calendar day [24:00] coincides with [00:00] at the
start of the next calendar day, e.g. [24:00] on 12 April 1985 is the same as
[00:00] on 13 April 1985. If there is no association with a date or a time
interval both a) and b) represent the same local time in the 24-hour
timekeeping system.
-------------------------------

A fellow countryman has a summary page about the format, including a direct
link to the ISO 8601 specification in PDF format:

http://www.cs.tut.fi/~jkorpela/iso8601.html

In addition, I suggest that you choose to use 00:00 rather than 24:00.

The only time of the day that can be written as 24:00 is the exact
moment of midnight, i.e. 24:00.00000. The next 1/10000th of a second you
are into the next day, and it can't be written 24:00.00001, it has to be
written 00:00.00001.
 
Back
Top