views:

215

answers:

2

Does the DateTime struct takes care of this? Does any other class/struct?

UPDATE :

I now have read that leapseconds are only announced 6 months in advance, since the rotation of the earth is not that predictable...

Since there's no possibility to implement that in future dates, I can imagine they just omitted them?

+2  A: 

As far as I know, .NET's DateTime struct does NOT automatically handle leap seconds. I don't think you can even set seconds higher than 59 in .NET's DateTime. However, in Java, you are allowed to set seconds to be 0 - 61, because the ISO standard for it allows for 2 leap seconds per year.

EDIT: I Tried it for kicks:

Trying Dim dt As New DateTime(2008, 12, 2, 12, 34, 61) in .NET throws this message (61 being the number of seconds):

"Hour, Minute, and Second parameters describe an un-representable DateTime."

Cory Larson
A quick look at the implementation of DateTime in Reflector shows the logic in the private helper TimeToTicks: ((second < 0) || (second >= 60)) ... throw...
Richard
+1  A: 

I think the answer to both your questions is No. Reference: http://silverlight.net/forums/t/12114.aspx

Paw Baltzersen