From: <pa...@us...> - 2011-04-23 20:10:55
|
Revision: 5753 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5753&view=rev Author: patearl Date: 2011-04-23 20:10:49 +0000 (Sat, 23 Apr 2011) Log Message: ----------- Types: Improved compatibility of TimeAsTimeSpanType by avoiding dependence on specific base date. (Specifically fixes problem with PostgreSQL.) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Type/TimeAsTimeSpanType.cs Modified: trunk/nhibernate/src/NHibernate/Type/TimeAsTimeSpanType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/TimeAsTimeSpanType.cs 2011-04-23 20:05:03 UTC (rev 5752) +++ trunk/nhibernate/src/NHibernate/Type/TimeAsTimeSpanType.cs 2011-04-23 20:10:49 UTC (rev 5753) @@ -35,7 +35,7 @@ if(value is TimeSpan) return (TimeSpan)value; - return ((DateTime)value).Subtract(BaseDateValue); + return ((DateTime)value).TimeOfDay; } catch (Exception ex) { @@ -51,7 +51,7 @@ if (value is TimeSpan) //For those dialects where DbType.Time means TimeSpan. return (TimeSpan)value; - return ((DateTime)value).Subtract(BaseDateValue); + return ((DateTime)value).TimeOfDay; } catch (Exception ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |