title: OSX - How to get the creation & modification time of a file from the command line
body: <p>While solving some programming puzzle, I wanted to see how long it took me to write a solution to the problem. To do so, I thought it'd be a good idea to compare the file creation date with the latest modification date.</p>
  
  <p>In the terminal (OSX), I tried the following command and was surprised to see the same date three times in a row:</p>
  
  <pre><code>stat my_file.py
  16777220 10280844 -rw-r--r-- 1 username staff 0 7214 \
  "Dec  5 08:32:39 2015"  \
  "Dec  5 08:32:39 2015"  \
  "Dec  5 08:32:39 2015"  \
  "Dec  5 08:32:39 2015" 4096 16 0 my_file.py
  </code></pre>
  
  <p>The way I created then modified the file:</p>
  
  <pre><code>touch my_file.py
  vim my_file.py   # &lt;- modify some content
  stat my_file.py
  </code></pre>
  
  <p>Any idea on how to get these two dates from the command line?</p>
  
  <p><strong>Clarification: I do not want to time the execution time of the script.</strong></p>
  
  <p><strong>EDIT</strong> : The issue was with vim changing the creation date on save, the accepted answer still answers the question in depth for those who are interested.</p>