title: Comparing LastWriteTime and CreationTime
body: <p>If a file is created and written once, I am expecting that LastWriteTime is the same as CreationTime. This code appears to say it is not true. Is there greater precision stored with these timestamps? Is a ToString and comparison the only way?</p>
  
  <pre><code>PS 09:30  C:\src\t
  &gt;Get-ChildItem .\uu.txt | Select-Object -Property Name,LastWriteTime,CreationTime
  
  Name   LastWriteTime       CreationTime
  ----   -------------       ------------
  uu.txt 2019-08-09 09:23:25 2019-08-09 09:23:25
  
  
  PS 09:30  C:\src\t
  &gt;Get-ChildItem .\uu.txt | ForEach-Object { $_.LastWriteTime -eq $_.CreationTime }
  False
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I ended up with the following code. If the difference between LastWriteTime and CreationTime is less than one second, this assumes the file has not been updated since creation.</p>
  
  <pre><code>$CloseEnough = New-Timespan -Seconds 1
  Get-ChildItem -File -Path 'C:\src\t' |
      Where-object { ($_.LastWriteTime - $_.CreationTime) -lt $CloseEnough }
  </code></pre>