Click here to Skip to main content
16,012,611 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want data annotation for date like my output should show like this
4/1/2014 4:47 PM


i am using mvc how to write there in model class for this type of output
Posted

sorry its not working showing error..
 
Share this answer
 
Just like yesterday! The answer is still the same:
C#
DateTime dt = new DateTime(2014, 1, 4, 16, 47, 0);
string formatted = dt.ToString("d/M/yyyy h:mm tt");
 
Share this answer
 
v2

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