title: Convert .NET Ticks to SQL Server DateTime
body: <p>I am saving a <code>TimeSpan</code> (from .NET) value in my db as <code>BIGINT</code> in SQL Server (saving the Ticks property). I want to know how to convert this <code>BIGINT</code> value to a <code>DATETIME</code> value in SQL Server (not in .NET). Any ideas?</p>
  
  <p>Cheers</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I am using NHibernate to map a <code>TimeSpan</code> property I have, and it persists the Ticks property. I use it for relative hours (or minutes) control over some date.</p>
  
  <p>Internally in the system everything is fine, this conversion isn't needed. However, when performing random queries in SQL Server, it is hard to understand the persisted form of a <code>TimeSpan</code>. So, a function where I pass the <code>Ticks</code> value and a <code>DateTime</code> is returned would give the amount in hours, minutes and seconds that that <code>TimeSpan</code> represents.</p>