Silly Billiseconds

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

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






Related content

Database Mirroring FAQ: Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup?

Question: Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup? This question was sent to me via email. My reply follows. Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup? Databases to be mirrored are currently running on 2005 SQL instances but will be upgraded to 2008 SQL in the near future.

Robert Davis


1,567 reads

Networking – Part 4

You may want to read Part 1 , Part 2 , and Part 3 before continuing. This time around I’d like to talk about social networking. We’ll start with social networking. Facebook, MySpace, and Twitter are all good examples of using technology to let…

Andy Warren


1,530 reads

Speaking at Community Events – More Thoughts

Last week I posted Speaking at Community Events – Time to Raise the Bar?, a first cut at talking about to what degree we should require experience for speakers at events like SQLSaturday as well as when it might be appropriate to add additional focus/limitations on the presentations that are accepted. I’ve got a few more thoughts on the topic this week, and I look forward to your comments.

Andy Warren


360 reads