Current Month in Specific Format

How can we get the current month in Number format as below?

*For Example the current month is June
*So it should show 6 Not 06

You can Try This one
now.ToString(“MM”).Replace(“0”,“”)

Regards,
Saloni

Hi @anmita
If you want current month in numbers

Datetime.now.tostring(“MM”).replace(“0”,“”)

Hope this helps

Or an alternative solution without replace @anmita

Now.toString(“M”)

@anmita

You just need to change the format of the datetime.

Datetime.now.tostring(“M”)

Thanks Everyone For the Solutions:)

1 Like

No problem

Happy automation

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.