title: Getting the difference in minutes between two date columns
body: <p>I have a file which contain two columns(start date time and end date time) I want to calculate the difference between these dates(in Mins). and store the difference in another column.</p>
  
  <p>Source File</p>
  
  <pre><code>20121224 22:16:10|20121224 23:03:34
  </code></pre>
  
  <p>Output File</p>
  
  <pre><code>20121224 22:16:10|20121224 23:03:34|73
  </code></pre>
  
  <p>Can anyone help on this. Any help is appreciated.</p>
  
  <p>Please tell me what is the problem in below command</p>
  
  <pre><code>echo "20121224 22:16:10|20121224 23:03:34"|awk -F'|' '{"date -d "$1" +%s"|getline d1;"date -d "$2" +%s"|getline d2;print $1"|"$2"|"d2-d1}'
  </code></pre>
  
  <p>I am getting below error while executing the command</p>
  
  <pre><code>sh: +%s: command not found
  </code></pre>
  
  <p>Please help me !!</p>