I am having a problem compairing dates with NHibernate:
For example i have this named query
Code:
<query name="Fair.GetOngoing">from Fair where starting_date <= ? and end_date >= ?</query>
I have a date stored in my db 08/03/2006 (which is in the United Kingdom ddmmyyyy format) but when is compare this with the current shortdatetime Derived from System.DateTime.Now.ToShortDateString(); which is 09/03/2006 also in ddmmyyyy.
"starting_date <= ?" nhibernate Is evaluating this to false and it only appears to evaluate to ture when i change the stored start date to 03/09/2006 so i appear hibernate is converting it to us style.
How do i fix this?