Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to change month name as month number.Can you guys help me out........


Thanks,
Manasa
Posted

Assuming you don't want to type them out, or want to be able to use the users month names:
C#
string monthName = "April";
int monthNo = DateTime.ParseExact(monthName, "MMMM", CultureInfo.CurrentCulture).Month;
 
Share this answer
 
Comments
Aarti Meswania 8-Jan-13 5:23am    
5+! :)
Hi

You can always use Enum, read about how they work,am sure ul make it...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900