By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

How to get the date list between two dates

P: 3
i have two dates like 2013-1-1 and 2013-1-10 i want to get the output like 2013-1-1,2013-1-2,2013-1-3,.....2013-1-10 how i l get this give me some solution please.
Dec 2 '13 #1
Share this Question
Share on Google+
6 Replies


Exequiel
100+
P: 287
is that dates from 2013-1-1 to 2013-1-10 are came from an array or in the database?,
Dec 2 '13 #2

P: 3
ya this is coming 4m database only.Noproblem if u solve this by giving this values also i can able to do further
Dec 2 '13 #3

Exequiel
100+
P: 287
i think you can try this one. . .
Expand|Select|Wrap|Line Numbers
  1. $datas = mysql_query("SELECT * FROM tbl_date order by thedate asc");//your table name
  2.         while($data = mysql_fetch_array($datas))
  3.         {
  4.             echo $data['thedate'].'<br>';
  5.         }
Dec 2 '13 #4

Exequiel
100+
P: 287
its not a javascript, its php with sql I used the order by to order the date ascending . . . using that order by, it will automatically sort your data by the field name thedate
Dec 2 '13 #5

P: 3
ya i got ur point but i need to write the programme in a servlet.
Dec 2 '13 #6

Exequiel
100+
P: 287
what do you mean by servlet.?
Dec 3 '13 #7

Post your reply

Sign in to post your reply or Sign up for a free account.