title: How to convert DateTime to Integer and check the difference?
body: <p>I'm trying to compare the difference between two times in the day. I'm getting time in UTC format. Do I have to convert DateTime to integer in order to get the difference and if yes how?</p>
  
  <p>This is my code</p>
  
  <pre><code>Dim ct As DateTime = DateTime.UtcNow
          Dim int_ct As Integer = Convert.ToInt32(ct)
          MsgBox(ct + " | " + int_ct)
          If (System.IO.File.Exists(System.IO.Path.GetTempPath.ToString + "\tempfile.data")) Then
              Dim time As DateTime = System.IO.File.ReadAllText(System.IO.Path.GetTempPath.ToString + "\tempfile.data")
              Dim int_time As Integer = Convert.ToInt32(time)
              If ((int_ct - unlockedtime) &lt; int_time) Then 'unlockedtime is Int variable
                  Return False
              Else
                  Return True
              End If
          End If
  </code></pre>