how to convert string to an integer and how to do calculations like add.,sub.,mult. on it

How to convert string into an integer or number
For example :

% set tim = `date`
% echo $tim
Tue Feb 22 16:25:08 IST 2011

here How to increment time by 10 hrs

like 16+10 , here 16 is a string in date cmd. .. how to convert 16 to an integer and added to a another nimber ?

Thanks in advance
krishna chaitanya

date -d '10 hours'

my question is too generic way
see ,, long running jobs are there
i need to check how much time that job run
so how can i convert the string to integer and make evaluation

Thanks
krishna chaitanya

As a rule, you would use $hour for a numeric value vice ${hour} for text.

# hour=`date +%H`
# echo $hour
10

# hour_plus_10=$(($hour + 10))
# echo $hour_plus_10
20

To use the string version:

# echo "What is your ${hour}-${hour_plus_10}?"
What is your 10-20?