Leading zero for period

Leading zero for period

Hi,

I have a date field capture posting date. Then, a formula field convert the posting date (2013-02-01) to period (201302). I have applied this formula on the formula field:

((PostDate.getYear()).toString()) + (PostDate.getMonth()).toString()

System return 20132 but I need the leading zero for Feb -> 02 instead of 2; otherwise sorting will be a problem. I didn't find a padding function and looks the substring function does not support -2 as starting position.

Is there any workaround solution?

Quincy