Select month from Date

good afternoon i would like to select month value from a date value

example:
Value date: 24.05.2020
extracted value: select may from dropdown list

1 Like

Hey @uzair_khan

Kindly try this,

dateValue.ToString("MMM")

Pass the above to your select activity, Hope this helps.

Thanks
#nK

1 Like

hi @Nithinkrishna it dint work

Hi @uzair_khan,

Try this -

DateTime.ParseExact(“24.05.2020”,“dd.MM.yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MMM”)

This will give the month like “May” which you can store in a variable or directly use.

thanks

hi @Shikhar_Tandon getting error like Select Item: String was not recognized as a valid DateTime.

I believe the date format is different from what you are showing, Just do a activity use a message box and print the date what you are getting, print the direct output it will show if hh,mm is also present or not, post that let us know.

thanks

Hi @uzair_khan,

Try this -

DateTime.ParseExact(“2017-11-01”,“yyyy-MM-dd”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MMM”)

Thanks

1 Like

Thanks brother @Shikhar_Tandon it worked

1 Like

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