troubleshooting Question

How can I parse this dynamic dropdown list to show only dd/mm/yyyy?

Avatar of devnewbee
devnewbee asked on
C#Visual Basic.NET.NET Programming
7 Comments1 Solution419 ViewsLast Modified:
Given the below list call and bind, how can I parse the dd output to be just dd/mm/yyyy?

      protected void Page_Load(object sender, EventArgs e)
        {
            DropDownList3.DataSource = this.GetQuarter(new System.DateTime(2008, 4, 10), 3);
            DropDownList3.DataBind();
        }

        public List<DateTime> GetQuarter(DateTime startDate, int years)
        {
            List<DateTime> lst = new List<DateTime>();
            DateTime endDate = startDate.AddYears(3);
            while (startDate < endDate)
            {
                lst.Add(startDate);
                startDate = startDate.AddMonths(3);
            }
            return lst;
        }
ASKER CERTIFIED SOLUTION
starlite551

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros