idsanjeev Posted June 6, 2008 Share Posted June 6, 2008 My need to display all dates of 1 or 2 months previous from crrent dates means if current date is 01-06-2008 then all date between 01-05-2008 to 01-06-2008. How can i do it. Link to comment Share on other sites More sharing options...
jesh Posted June 6, 2008 Share Posted June 6, 2008 In javascript, you can do something like this: <html><body><script type="text/javascript">var today = new Date();var start = new Date();start.setMonth(today.getMonth() - 1);while(start <= today){ document.write(start.toLocaleString()); document.write("<br />"); start.setDate(start.getDate() + 1);}</script></body></html> Link to comment Share on other sites More sharing options...
idsanjeev Posted June 7, 2008 Author Share Posted June 7, 2008 thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.