Good point, Jon
the AddDays(-1) at on 12/10/2003 at 2:15PM will give 12/9/2003 2:15PM
if you want to get the very BEGINNING then you'll want to look into the
DateTime constructors or even
DateTime.Now.Date.AddDays(-1)
--
Eric Newton
C#/ASP Application Developer
http://ensoft-software.com/ er**@cc.ensoft-software.com [remove the first "CC."]
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Bavo <an*******@discussions.microsoft.com> wrote: I am trying to work with datetime functions in C#. Can
anyone tell me how to get accurate yesterday using
current datetime?? I want to display yesterday and today
in two differnt text boxes in a web page.
What part of yesterday do you want? I'd suggest starting with
DateTime.Now.AddDays(-1) - that will give you the DateTime exactly one
day earlier than now.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too