DateTime Shorting in c#

Total Post:33

Points:231
C# 
C#
 2644  View(s)
Ratings:
Rate this:
How to short list of month in MMMM-yy formate?????
  1. Post:65

    Points:455
    Re: DateTime Shorting in c#

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

  1. Post:33

    Points:231
    Re: DateTime Shorting in c#

    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-04-2018 05:19:58 AM

Answer