i know my question is similar like this How to convert Month(Text) into number? , but I tried to follow this link but as a result it gives me the following error:
How can i do that? Or are there any other ways to convert the month’s name into number?
hi @Pratik_Wavhal, thanks for your suggestion I wanted to ask if you know if I use this method for example: “Now.AddMonths(-1).ToString(“MMMM”, System.Globalization.CultureInfo.CreateSpecificCulture(“it”)).ToString” i know I find the previous month but if we were in January with this method, the result will be December?
In any case if I find my month with this method “Now.AddMonths(-1).ToString(“MMMM”, System.Globalization.CultureInfo.CreateSpecificCulture(“en”))", then can I use it in the function you suggested me “A = DateTime.ParseExtract(“29”+ month+“2015”,“dd.MMMM.yyyy”,new CultureInfo(“en-US”))”?
First I want to find the previous month with this method ----> Now.AddMonths(-1).ToString(“MMMM”, System.Globalization.CultureInfo.CreateSpecificCulture(“en”))
Then once I find the month I want to convert it to number.
I found a solution: first i find previous month with this method ----> firstVariableString = Now.AddMonths(-1).ToString(“MMMM”, System.Globalization.CultureInfo.CreateSpecificCulture(“en”))
then i use other assign activity:
secondVariableString = Datetime.ParseExact(firstVariableString.ToString ,“MMMM”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MM”)