Date() and time()
How can be use date() and time() in asp.net?
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Chetan koralli14 reputationPosted Jan 22, 2012, 7:23 PM EST
Posted Jan 22, 2012, 9:43 PM EST
Anuja PawarRank #1,404 · 1.2K reputationPosted Jan 24, 2012, 12:56 AM EST
A date and time format string defines the text representation of a DateTime
Refer this for more information on datatime
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
VulpesRank #55 · 29.2K reputationPosted Jan 24, 2012, 4:51 AM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 24, 2012, 9:25 PM EST
In .net DateTime has property for getting Date.
DateTime t = DateTime.Now;
var date = t.Date;
var time = t.TimeOfDay;
hope this help.