Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hello,
I want dates between two dates , Its means list of dates between two dates can u guide or send any snippets
Posted 20-May-12 20:05pm
kingsa1.5K
Comments
justinonday at 21-May-12 1:08am
   
Make it clear...!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
JF2015 at 21-May-12 1:17am
   
Good one. +5
sravani.v at 21-May-12 1:37am
   
Thank you JF2015
P.Salini at 21-May-12 1:49am
   
Good link +5
sravani.v at 21-May-12 1:51am
   
Thank you salini
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

private List<datetime> GetDatesBetween (DateTime startDate , DateTime endDate)
        {
            List<datetime> allDates = new List<datetime>();
            for (DateTime date = startDate; date <= endDate; date = date.AddDays(1))
                allDates.Add(date);
            return allDates;
 
        }
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

you can use loop sequence
 
e.g.
 

 
DateTime dt1 = new DateTime(2012, 5, 1);
        DateTime dt2 = DateTime.Now;
 
        DropDownList ddl = new DropDownList();
        while (dt1 < dt2)
        {
            ddl.Items.Add(dt1.ToString("dd-MMM-yyyy"));
            dt1.AddDays(1);
        }
 

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

try this url..................
[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 334
2 CPallini 275
3 DamithSL 230
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 6 Mar 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100