Link to home
Start Free TrialLog in
Avatar of rowmark
rowmark

asked on

Display 1st value and last Date value from an Array in C#

Dear experts,

I am displaying dates from the array as shown as below:

             foreach (Day d in days)
            {
                DateTime h = new DateTime(d.date.Year, d.date.Month, d.date.Day, 0, 0, 0);
                output.Write(h.ToString("D"));  
            }

This is Displaying dates as shown as below:
4/9/2007            4/10/2007     4/11/2007       4/12/2007        4/13/2007    

Instead is there a way I can just display something like this:
April 9 2007- April 13 2007

Please help
ASKER CERTIFIED SOLUTION
Avatar of DireOrbAnt
DireOrbAnt

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Priyesh
Priyesh

           foreach (Day d in days)
            {
                DateTime h = new DateTime(d.date.Year, d.date.Month, d.date.Day, 0, 0, 0);
                output.Write(h.ToString("MMMM dd yyyy"));  
            }