Assign time value

I'm trying to monitor the traffic for few hours but still don't know how to make it possible. I try to set the value of time HH MM SS each into variables but for Hour, there's an error occurred as follow.

typeset -i hour=$(date +%H)
typeset: 09: value too great for base (error token is "09")

"09" is my current hour time. Could you please suggest me how to solve this problem? Thank you very much for your kind advice.

P.S. this does not happen with Minutes and Seconds.

Which shell are you trying? IT is working on bash?

Actually it will happen with minutes and seconds if they are integers too. It just hasn't happened yet. Posix, in its wisdom, has decided that posix compliant shells must treat integers with a leading zero as octal.

Try this:

x=$(date +%H)
typeset -i hour=${x#0}