How do i extract the month number out of today's date in the modify date activity

Hi Everyone,

Today is 10/16/2023. How do i extract the month number: 10 from the Modify Date activity as shown for custom format as shown?
image

Hi @josiahgoh276

Try this:
dateTime.Today.Month.ToString

image

Hi @josiahgoh276

Try with this expression

CDate(ModifyDateVariable).ToString("MM")

Some thing like this in the image @josiahgoh276

image

Hi @josiahgoh276

You can try this

Cheers!!

Hello @josiahgoh276
Try this syntax instead of Activity

DateTime.Now.month    -----------> Output= 10
DateTime.Now.Day    -------------> Output = 16
DateTime.Now.Year   -------------> Output= 2023

image

Hi, i don’t seem to be able to replicate this. I tried it:

and obtain the following error:
image

@josiahgoh276

Please check what i am suggest

@josiahgoh276

even that is also working

try this way

@josiahgoh276

Hi Praveen, it doesn’t work for me

Result:
image

Just try like this @josiahgoh276

Hi Gokul,

I need this month number to be in a string variable. Can you help with that?

@josiahgoh276

Month=Now.ToString("MM")

Hi Lakshman,

I cannot get the result:

This is the result i got
image

@josiahgoh276

Can you show your variables panel

Hi @josiahgoh276

Have you tried to uninsatll the studio and give a try

Hi @josiahgoh276 ,

Can you please remove activities and create again.

Thanks,
Sandhiya P

i am using studiox so there is no variables panel, only data manager:

@josiahgoh276

Once try to Reinstall UiPath StudioX