title: Difference in two dates in unix shell scripting
body: <p>I have a two dates in date +"%Y%m%d%H%M%S" format. How to find the difference and how to check whether the difference is more than 4 hours?
  This is how i have tried</p>
  
  <pre><code>echo $(( ( $(date +"%Y%m%d%H%M%S") - $(date +"%Y%m%d%H%M%S" -d "1970-01-01 + $(stat -c '%Z' filename ) secs"))))
  </code></pre>
  
  <p>date command returns this</p>
  
  <pre><code>Sun Sep  6 10:35:19 CDT 2015
  </code></pre>