Naim
(Ahmad Naim)
February 13, 2019, 9:26am
1
Hi All,
I have a variable name is month (month variable is in String).
I wanted that if month value is month=03 the result should be March… Means it converted it into month name.
every time month value will be change
Please help me on this
Regards,
Naim
CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(3)
Please import namespace “System.Globalization”
5 Likes
System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(3)
4 Likes
Naim
(Ahmad Naim)
February 13, 2019, 10:30am
4
Thanks for your reply @Rahul and @Karthik I have dome same as you suggest but I am facing error
i.e. ‘CurrentCulture’ is not a member of “System.Globalization.CompareInfo”…/
Knidly suggest
Naim
(Ahmad Naim)
February 13, 2019, 10:40am
6
HI Rahul,
I am using same as suggested by you…
But I am getting error.
Error is : ‘CurrentCulture’ is not a member of “System.Globalization.CompareInfo”
I have add name space also.
Thanks
@Naim
use this
System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat.GetMonthName(1)
3 Likes
Naim
(Ahmad Naim)
February 13, 2019, 10:51am
8
Thank you everyone for your support…
Now It’s working.
1 Like
can anybody here help me to do the reverse ?
DateTime.ParseExact(MonthName, “MMMM”, CultureInfo.CurrentCulture ).Month
@Shivamvats1994
Please specify what datataype you want to reverse or example for your specific scenario which will be quite helpful to understand the problem statement.