Blog Post

Silly Billiseconds

,

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

ValueSymbolName
10-1dsdecisecond
10-2cscentisecond
10-3msmillisecond
10-6µsmicrosecond
10-9nsnanosecond
10-12pspicosecond
10-15fefemtosecond
10-18asattosecond
10-21zszeptosecond
10-24ysyoctosecond

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

MegaSeconds
---------------------------------------
163.6097190000

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating