title: Bash comparing two timestamps
body: <p>i want to compare if &quot;endts (it contains a timestamp)&quot; is older than 24hours but im stucked with it.</p>
  <pre><code>endline=`cat /xy.json 2&gt;&amp;1 | grep -ie endTime`
  endts=`sed s/\&quot;endTime\&quot;:\ //g &lt;(echo $endline) | sed s/,//`
  current=`date +%s`
  
  if [ $endts -gt $current ]; then
                  msg='older than 24hrs'
                  exitcd=2
  else
                  msg='not older than 24hrs'
                  exitcd=0
  fi
  
  echo $msg
  exit $exitcd
  </code></pre>
  <p>i've tried with -gt 86400 but its not working</p>