title: Converting unix time to DateTime
body: <p>I would like to convert a Unix time stamp to a VB.NET DateTime.</p>
  
  <p>I have tried </p>
  
  <pre><code>Public Function UnixToDateTime(ByVal strUnixTime As String) As DateTime
  
      Dim nTimestamp As Double = strUnixTime
      Dim nDateTime As System.DateTime = New System.DateTime(1970, 1, 1, 0, 0, 0, 0)
      nDateTime.AddSeconds(nTimestamp)
  
      Return nDateTime
  
  End Function
  </code></pre>
  
  <p>But when I feed it </p>
  
  <pre><code>strUnixTime = "1401093810"
  </code></pre>
  
  <p>I get the return value </p>
  
  <pre><code>nDateTime = #1/1/1970#
  </code></pre>
  
  <p>What am I doing wrong?
  Thank you</p>