Arithmetic on timestamps

Hi Friends,
please advise on shell script to add two time stamps
for example :

a=12:32
b=12:00
c=a+b=00:32

please help me to find shell script to add to two time stamps, as i need to convert time from EST to GMT or SST to prepare status of jobs in unix and to specify estimated time to complete one job.

thanks in advance
Bali Reddy

i have written a script to take the time difference of two time stamp please modify it as you need

awk -v start_time=$1 -v end_time=$2 'BEGIN{
if ( start_time !~ /^[0-9]/ || end_time !~ /^[0-9]/ )
usage(start_time,end_time)
split(start_time,T2,":")
split(end_time,T1,":")
start_seconds=T1[1]*60*60+T1[2]*60+T1[3]
end_seconds=T2[1]*60*60+T2[2]*60+T2[3]
if ( start_seconds > 86401 || end_seconds > 86401)
usage("out_off_range","")
elapsed_seconds=start_seconds-end_seconds
if( elapsed_seconds < 0 )
{elapsed_seconds=elapsed_seconds*-1
calculate(end_time,start_time,elapsed_seconds)}
else
calculate(start_time,end_time,elapsed_seconds)}
function calculate(start_time,end_time,elapsed_seconds){
HH=elapsed_seconds / 3600
MM=(elapsed_seconds % 3600) / 60
SS=elapsed_seconds % 60
printf  "TIME DIFFERENCE BETWEEN "start_time"(START TIME)-"end_time"(END TIME)--> +%02d:%02d:%02d\n",HH,MM,SS }
function usage(start_time,end_time){
if( start_time=="out_off_range" )
printf "TIME OUT OFF RANGE\n"
else
printf "INVALID TIME FORMAT "start_time" "end_time"\n"
printf "USAGE : time_diff.sh <HH:MM[:SS]> <HH:MM[:SS]>\n"
exit}'

if you know time diffrence
try this

[root@Reddyraja reddy]# date +"%F %T"
2009-03-17 12:53:11
to add 10 minutes
[root@Reddyraja reddy]# date +"%F %T" -d" 10 minutes"
2009-03-17 13:03:13
to subtract 10 minutes
[root@Reddyraja reddy]# date +"%F %T" -d" 10 minutes ago"
2009-03-17 12:43:16

[root@Reddyraja reddy]# date +"%F %T" -d" 5 days 10 minutes ago"
2009-03-22 12:45:47
[root@Reddyraja reddy]# date +"%F %T" -d" 5 days ago 10 minutes ago"
2009-03-12 12:46:01
[root@Reddyraja reddy]# date +"%F %T" -d" 5 days ago 10 minutes "
2009-03-12 13:06:14
[root@Reddyraja reddy]# date +"%F %T" -d" 5 days 10 minutes "
2009-03-22 13:06:19

find unix time stamp in GST
and export TZ=EST

[root@Reddyraja reddy]# export TZ=IST
[root@Reddyraja reddy]# date +%s
1237275038
[root@Reddyraja reddy]# date +"%F %T" -d@1237275038
2009-03-17 07:30:38
[root@Reddyraja reddy]# export TZ=EST
[root@Reddyraja reddy]# date +"%F %T" -d@1237275038
2009-03-17 02:30:38

when i tried to verify the output with below input
start time 23:24:00 end time time :03:24:00 out put is +20:00:00 istead of 04:00
Please update to remedify abpve scenario, it appers that we should subtract from 24