Click here to Skip to main content
15,899,126 members
Please Sign up or sign in to vote.
1.33/5 (3 votes)
How to code to separate the time and date to C# windows form application. Please help me
Posted
Updated 22-Sep-10 21:41pm
v2
Comments
Johnny J. 23-Sep-10 3:42am    
This is the second time I have formatted the subject for you. I'll explain again: When you write the subject text IT SHOULD SAY SOMETHING ABOUT WHAT YOUR QUESTION IS ABOUT. Not just "Help Me".

Use a DateTime class to get the date time. Parse or Format as needed. It has lot of built-in methods and properties
 
Share this answer
 
v2
Comments
bAdzzzz 27-Sep-10 21:33pm    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
Seems like this question has already been answered in another thread started by a bAdzzzz look-alike:

http://www.codeproject.com/Questions/112008/separate-date-and-time.aspx[^]
 
Share this answer
 
Comments
bAdzzzz 27-Sep-10 21:33pm    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
DateTime dt = DateTime.Now;  // for example
DateTime date = dt.Date;
TimeSpan time = dt.TimeOfDay;
Enjoy!
 
Share this answer
 
Comments
bAdzzzz 27-Sep-10 21:35pm    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.

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