This weekend is an extra long one as there will be an extra second inserted after 23:59:59
on June 30th.
We have a system that logs a lot of data around the clock and one of the business rules is that no two records can be logged as having occurred at the same time, to within one second.
We're using UTC datetimes along with the new datetimeoffset
data type, but as far as I can tell they won't let you have more than 60 seconds in a minute.
Certainly, this throws an error:
select datediff(ss, getdate(), '30-jun-2012 23:59:60')
But according to the UTC gods this will be a real time. Events can take place at 23:59:60
but we have no way of recording this fact.
23:59:59
plus one second offset will still be considered 00:00:00
on July 1st.
How can I correctly log that an event occurred at 23:59:60
in the database?