Click here to Skip to main content
16,012,198 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I used system.datetime.now.tostring("dd-MMM-yyyy") to get o/P as 07-Mar-2013 but i getting o/p as 07-Mas-2013 plz reply soon y i getting Mas instead of Mar
Posted

1 solution

What you see is the conversion done in your culture. If you want to go for a special culture (en-us?) use this as IFormatProvider parameter. It happens that en-us is the "Invariant" culture. so you can just use:

DateTime.Now.ToString("dd-MMM-yyyy", System.Globalization.CultureInfo.InvariantCulture)
 
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