Printed 2017/01/22 09:48PM

Silly Billiseconds

By Phil Factor, 2011/01/13

You have to admire Microsoft for sticking to their guns, even when being palpably stupid. I refer, of course to the SqlDateTime structure constructor in .NET 2 through to 4. See here

public SqlDateTime(
int year,
int month,
int day,
int hour,
int minute,
int second,
int bilisecond

See also the SqlDateTime Structure where it is spelt ‘billiseconds’.

Yes, you read that right: Bilisecond. This is odd since the structure only has an accuracy of 3.33 milliseconds. Since 2006, this has been a joke amongst .NET developers, and caused some bewilderment to Mono. There is, of course, no such thing as a bilisecond, however much the Microsoft people want to change the English Language. It isn’t a billionth of a second. An American billionth of a second is called a nanosecond (10-9), and a british billionth of a second is a picoseconds which is 10-12 of a second. (an american trillionth), and there is a microsecond which is equal to one millionth (10-6) of a second (1000 nanoseconds). We than have the millisecond, which is a thousandth (1/1,000) of a second. You will sometimes hear of the centisecond, which is 10 milliseconds (a hundredth of a second). Here is the whole list


In the case of the Billisecond, or bilisecond, we think it is a microsecond. The Dateime2 DataType of SQL Server is supposedly accurate to 100 nanoseconds, so it could be that a bilisecond was intended to be the same as 100 nanoseconds.

So the next question is this; How many seconds has this error been in the documentation unfixed? Here is our SQL Calculator.

DECLARE  @SecondsSinceBili BIGINT
SELECT @SecondsSinceBili=DATEDIFF(second,'07 Nov 2005' ,GETDATE())
SELECT @SecondsSinceBili/1000000.00 AS MegaSeconds


Copyright © 2002-2017 Redgate. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.