|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Are they the same day?Hello, friends,
What is the best way to test if two date values are the same day (same hour) or not in c#.net? As you know, in VB6, we have a fuction DateDiff("d", date1, date2). Do we have a similar one in .net? Thanks. Andrew <And***@discussions.microsoft.com> wrote:
> What is the best way to test if two date values are the same day (same hour) if (day1.Date==day2.Date)> or not in c#.net? { ... } and if (day1.Date==day2.Date && day1.TimeOfDay.Hours==day2.TimeOfDay.Hours) { ... } -- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet If replying to the group, please do not mail me too
Other interesting topics
Locking Desktop and Threading Issue
The Interlocked on the Edge of Forever Truly cross platform? Questions about clickOnce case values in switch statement? Overriding "OnXXX" versus adding event handler Windows Workflow - What basic tutorials? What's going on here? convert an object to string and back (in a culture independent fashion) Getting 3.0 Facts Straight .Net Windows Service ...data access problem |
|||||||||||||||||||||||