Hi all,
We currently use SQL Server 2005 with collation Danish_Norwegian_CI_AS and the web server executing queries has its regional date settings set to dd.MM.yyyy. The dates that appear in sql generated by NHibernate becomes: '27.04.2009 15:06:21' (27th of April 2009), which correspond to the regional date settings and should also correspond to the SQL collation. This however result in the following sql exception: "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
This is a sql issue, but related to this I have two questions: 1) Is NHibernate suppose to take regional settings into account and not use invariant (DateTime.ToString() .vs. DateTime.ToString(CultureInfo.InvariantCulture)) or use ISO (yyyy-MM-dd)? 2) What is the recommended solution to culture settings in NHibernate, specifically related to dates? Can we control them?
Thanks,
Jon Arild Tørresdal
|