title: how to convert 2012-05-03T25:00:00 to 2012-05-04T01:00:00 in unix
body: <p>I am not sure how this will be done in unix can anybody help/suggest to convert 
      <code>2012-05-03T25:00:00 to 2012-05-04T01:00:00</code> in Unix command/script</p>
  
  <p>In my file I have more than one occurrence with different times those needs to converted to next day</p>
  
  <pre><code>2012-05-03T25:00:00 to 2012-05-04T01:00:00
  2012-05-03T26:50:00 to 2012-05-04T02:50:00
  2012-05-03T31:59:59 to 2012-05-04T07:59:59
  </code></pre>
  
  <p>etc</p>
  
  <p>I tried it but somehow sed is not working </p>
  
  <p>Date.txt</p>
  
  <pre><code>2009-09-12T05:18:@00@+10:00,D,
  2009-09-12T05:24:00+10:00,2009-09-12T05:24:@00@+10:00,D,
  2009-09-12T05:25:00+10:00,2009-09-12T05:25:@00@+10:00,D,
  2009-09-12T05:27:00+10:00,2009-09-12T05:27:@00@+10:00,D,
  2009-09-12T30:29:00+10:00,2009-09-12T05:29:@00@+10:00,D,
  2009-09-12T29:31:00+10:00,2009-09-12T05:31:@00@+10:00,D,
  2009-09-12T28:33:00+10:00,,D,
  2009-09-12T27:00:@00@+10:00,U,
  2009-09-12T26:01:00+10:00,2009-09-12T05:01:@00@+10:00,U,
  2009-09-12T24:04:00+10:00,2009-09-12T05:04:@00@+10:00,U,
  2009-09-12T24:59:59+10:00,2009-09-12T05:06:@00@+10:00,U,
  2009-09-12T30:08:00+10:00,2009-09-12T05:08:@00@+10:00,U,
  2009-09-12T31:59:59+10:00,2009-09-12T05:10:@00@+10:00,U,
  2009-09-12T05:17:00+10:00,,U,
  2009-09-12T25:25:@00@+10:00,D,
  </code></pre>
  
  <p>script.sh</p>
  
  <pre><code>awk -F"T" -v OFS=',' '{print $1}' date.txt &gt; tmpdate
  uniq -d tmpdate &gt; tmpuniq
  rm tmpdate
  date1=`cat tmpuniq`
  date2=`date --set="$date1" +%F`
  date3=$(date --date="$date2" -d "+1 day" +"%F")
  T1=$date2+"T24"
  T2=$date3+"T00"
  echo $T1
  echo $T2
  dos2unix date.txt
  #sed -i 's/$T1/$T2/g' date.txt &gt; test.txt
  #sed -i 's/"$T1"/"$T2"/g' date.txt &gt; test.txt
  sed -i 's/'$T1'/'$T2'/g' date.txt
  </code></pre>
  
  <p>Any help much appreciated</p>