Click here to Skip to main content
15,885,132 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a code written on the page load of a page and i am not able to understand it..
can somebody please explain me that.. code is:
C#
DateTime LastDateOfPreviousMonth;
           LastDateOfPreviousMonth = Convert.ToDateTime(DateTime.Now.AddDays((-1) * DateTime.Now.Day).ToShortDateString());

           txtStartDate.Value = new DateTime(LastDateOfPreviousMonth.Year, LastDateOfPreviousMonth.Month, 1).ToString("MM/dd/yyyy");
           txtEndDate.Value = LastDateOfPreviousMonth.ToShortDateString();

It shows which dates in Startdate and enddate textbox.
I am new to .net.. Please help..!
Posted
Updated 22-Jan-15 18:20pm
v2

1 solution

This looks awfully like a homework. If true, I suggest that you both:
 
Share this answer
 
Comments
BillWoodruff 23-Jan-15 0:57am    
+5 Nice to see a newcomer given constructive advice !
Wendelius 23-Jan-15 1:20am    
Thanks :)

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900