Date Formatting in VBScript - Prefix Month with 0 (zero) e.g. 07 instead of 7

If i use

DatePart("m",Now()) ' out put will be 7

but my requirment is to display "07" rather than "7"

Is there any direct method to achieve this, or should should I write custom code to prefix "0" zero?

Answers


they easy solution would be

right( "0" & DatePart("m",Now()) ,2)


Need Your Help

Can I declare a variable name like this $(variable name) in PHP?

php mysql variables variable-declaration

I want to get the resulting string(field name) of the mysql function, mysql_field_name() and declare that as a variable,so that I can use it later in my program.