title: Converting Nanoseconds to Datetime
body: <p>I'm having a little trouble converting nanoseconds to <code>DateTime</code> so i can use the Google Fit API (<a href="https://developers.google.com/fit/rest/v1/reference/users/dataSources/datasets/get" rel="nofollow">https://developers.google.com/fit/rest/v1/reference/users/dataSources/datasets/get</a>)</p>
  
  <blockquote>
    <p>Dataset identifier that is a composite of the minimum data point start
    time and maximum data point end time represented as nanoseconds from
    the epoch. The ID is formatted like: "startTime-endTime" where
    startTime and endTime are 64 bit integers.</p>
  </blockquote>
  
  <p>I was able to convert from datetime to Nanoseconds this way</p>
  
  <pre><code>DateTime zuluTime = ssDatetime.ToUniversalTime();
  DateTime unixEpoch = new DateTime(1970, 1, 1);
  ssNanoSeconds = (Int32)(zuluTime.Subtract(unixEpoch)).TotalSeconds + "000000000";
  </code></pre>
  
  <p>But now i need to convert nanoseconds to <code>DateTime</code>. How can i do it?</p>