Extract only month from an excel column which contains date

I have an excel with a column which contains date in format 20-11-2019. from this date I only need the month i.e 11 as November. How to do it?

@rifnanahas Read the Column Value and Check How the Format Appears in a Message Box, If the Format is 11/20/2019 then use this :
DateTime.ParseExact(row(“DateColumn”).toString,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).toString(“MM”)

This way you get the Month value as 11 as a String

is there any way to convert this 11 into november

@rifnanahas Can you try this :
DateTime.ParseExact(row(“DateColumn”).toString,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).toString(“MMMM”)

Hi @rifnanahas

DateTime.ParseExact(row(“DateColumn”).toString,“MM/dd/yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).toString(“MMMM”)

Thanks
Ashwin S

1 Like

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