I have need of different query for date in C#.
Thanks In Advance,
Chaitali
Date Related Query.....
3 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 attend4days leftRegister
Ravi ShekharRank #673 · 3.6K reputationPosted Jun 20, 2013, 2:49 AM EDT
which type of date query you want??? do clear.
Sunny SharmaRank #223 · 11.1K reputationPosted Jun 20, 2013, 3:15 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jun 20, 2013, 3:19 AM EDT
you can use like below
var current = DateTime.Now;
var currentDate = DateTime.Now.Date;
var currentYear = DateTime.Now.Year;
var currentMonth = DateTime.Now.Month;
var currentDay = DateTime.Now.Day;
Iftikar
Remember to click "Mark as Answer" on the post, if it helps you.