Re: DateTime.Compare question
- From: "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin@xxxxxxxxx>
- Date: Wed, 28 May 2008 13:44:40 -0700 (PDT)
On May 28, 2:58 pm, SandpointGuy
<Sandpoint...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
string dateTime = "5/28/2008";
DateTime.Compare(DateTime.Now,DateTime.Now) // returns 0
DateTime.Compare(DateTime.Now,DateTime.Parse(dateTime)) // returns 1
I need to compare 2 dates, using the second format, and I
dont understand why it isnt returning 0
Thank you
Hi,
DateTme.Now include a time component.
Also it might be possible that the first line (using Now both times)
give also <>1, depending of how fast both evaluations are performed
.
- Prev by Date: Re: C# Async Socket timeouts
- Next by Date: Re: Question about return style
- Previous by thread: Re: DateTime.Compare question
- Next by thread: Re: DateTime.Compare question
- Index(es):
Relevant Pages
|