So to solve this problem and get missing leading zero, you have to follow the example given below
The variable days store integer(Number, Numeric) value that comes dynamically, that's why the value is not surrounded by any " ". If days="01" then there was no problem by getting 01 as a 0 and 1 because any thing inside the double quotes is called string and we can get substring easily from string.
I know this tutorial is a bit technical but you will find this very much handy.
Thanks and Keep in touch.