Home > DeveloperSection > Forums > DateTime Shorting in c#
Manmohan Jha

Total Post:35

Points:245
Posted on    April-18-2014 5:00 AM

 C# C# 
Ratings:


 2 Reply(s)
 1950  View(s)
Rate this:
How to short list of month in MMMM-yy formate?????


Chris Anderson
Chris Anderson

Total Post:65

Points:455
Posted on    April-18-2014 10:31 PM

String.Format("{0:MMMM-yy}",DateTime.Now)

Manmohan Jha

Total Post:35

Points:245
Posted on    April-23-2014 8:33 AM

I've Solved this myself ...

string str="Jan-14,Apr-13,Feb-14,May-13,Mar-14,Nov-13,Oct-13,Jun-13,Sep-13,Aug-13,Dec-13,Jul-13";
In String >>>>
string sortedlist = string.Join(",", str.Split(',').OrderBy(s => DateTime.ParseExact(s, "MMM-yy", CultureInfo.CurrentCulture)).ToArray());

In ListBox >>>>
listBox1.DataSource = str.Split(',').OrderBy(s => DateTime.ParseExact(s, "MMM-yy", CultureInfo.CurrentCulture)).ToArray();

Modified On Apr-29-2014 08:40:45 AM

Don't want to miss updates? Please click the below button!

Follow MindStick