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
Value | Symbol | Name |
---|---|---|
10-1 | ds | decisecond |
10-2 | cs | centisecond |
10-3 | ms | millisecond |
10-6 | µs | microsecond |
10-9 | ns | nanosecond |
10-12 | ps | picosecond |
10-15 | fe | femtosecond |
10-18 | as | attosecond |
10-21 | zs | zeptosecond |
10-24 | ys | yoctosecond |
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