Click here to Skip to main content
15,909,445 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I like to convert this date format dd-MMM-yyyy to dd-MMM-yy,how could I do this using

C sharp code.

ex. 01-Jul-2012 converted to 01-Jul-12

My problem is like this


I a have a field name to Date Created, under this field are many dates

ex.

01-Jul-2012 these date must converted to 01-Jul-12
18-Dec-2011 18-Dec-11
27-May-2011 27-May-11
05-Jun-2012 05-Jun-12


Thank you for any input on my question.
Posted
Updated 6-Dec-12 17:27pm
v2

1 solution

look at this line of code.it is for converting current date format.
C#
System.DateTime.Now.ToShortDateString("dd-MM-yy");

either u can convert
C#
mydatestring.ToShortDateString("dd-MM-yy");
 
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