Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to add a date and time in textbox then next date of month automatical appear in next textbox
Posted

It is simple just use DateTime class
C#
DateTime now = DateTime.Now;
Textbox1.Text = now.ToString()  

it will dynamically update date and time on each page upload
 
Share this answer
 
C#
DateTime txtbox1_date = DateTime.Parse(DateTime.Now.ToString());

DateTime txtbox2_date = txtbox1_date.AddDays(1);
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 27-Jan-16 1:55am    
Amazing gibberish, the first line. You make a round trip: take time, convert to string, then parse to date time again.
You got big fat vote of 1 with strong recommendation to avoid answering any question. Pure inquirers who would have to read your posts. Please, do everyone a big favor, don't do it.
—SA
Arasappan 27-Jan-16 4:19am    
ok
Arasappan 3-Jun-16 7:10am    
Surgey..I may Gibberish..If they got logic mean then wont go long trip..

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