Converting month to corresponding number

Hi Friends,

I am looking for converting month into its corresponding number (Like 8 for Aug). So I have asked month as an input variable through a dialog box, type string, format “MMM”. now I have to save an excel with the month+1 as an file name.
Note: here I can not ask month directly as number or month+1 since I am using this variable at different places in bot.
E.g. If input is Aug, i need to convert this to Sep to use it in filename.
Can anyone help to convert the month string into its corresponding month number or convert this input variable to month+1?

Fine
welcome to uipath community
if the input is
str_input = “Aug”

then to get the next month

str_output = Datetime.Parseexact(str_input,“MMM”,system.globalization.cultureinfo.invariantculture).AddMonths(1).ToString(“MMM”)

where str_output will be Sep which we can use now in filename where we want

Cheers @rj14

1 Like

It worked… Thanks a lot for your help :slight_smile:

1 Like

Cheers @rj14

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