NHibernate Truncates Milliseconds when Using DateTime

It’s even documented, right here.  It’s a bit annoying, seeing as it violates the principle of least surprise, but it does make the DateTime type portable across database implementations.  However, if you want to just use your native precision, just declare it as having “Timestamp” type.  Problem solved.  No need to mess around with IUserType or worse.

Technorati Tags:

Published by

Unknown's avatar

Julian Birch

Full time dad, does a bit of coding on the side.

Leave a comment