Find Today? Date Using Code

  • Thread starter Thread starter Tim Whelan via DotNetMonster.com
  • Start date Start date
T

Tim Whelan via DotNetMonster.com

Hi, I?m programming a web app using c# and asp.net and I am trying to
display a list of performances that are scheduled in the next month, in a
listbox. So I need to get today?s date in my code and compare it to the
dates of all the concerts and display the appropriate ones. My main problem
is getting today?s date can anyone help.
Thanks in advance
Tadhg88
 
I would also like to add that it would be best to pass in a start date
and end date to a stored procedure and have your SQL do the compare in
the WHERE clause instead of returning all the rows and comparing in c#
code.

Best regards,
Jeffrey Palermo
 
Or DateTime.Today

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<[email protected]>

Bela Istok said:
DateTime now = DateTime.Now;

That includes the time too, to just get today use:
DateTime xToday = DateTime.Now.Date;


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.3.0 - Release Date: 21/02/2005



[microsoft.public.dotnet.languages.csharp]
 
Back
Top