Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / July 2007

Tip: Looking for answers? Try searching our database.

Date Diff problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Newman - 03 Jul 2007 09:42 GMT
Can anybody assist me in fixing this code to return the number of days
idfference

DateDiff("d", Date.Now, CDate(FILEMOVEDATE))

FILEMOVEDATE = '05/07/2007'

i was expecting a return of 2 but get a return of 1 instead,  any suggstions.
Joergen Bech <jbech<NOSPAM>@ - 03 Jul 2007 10:16 GMT
No problems. That is the correct value.

Maybe the code below might ring a few bells:

---snip---
       Dim dnow As Date = Date.Now
       Dim dfuture As New Date(2007, 7, 5)

       Dim span As TimeSpan = dfuture.Subtract(dnow)

       MsgBox(span.Days.ToString)
       MsgBox(span.Hours.ToString)
       MsgBox(span.Minutes.ToString)

       MsgBox(span.TotalDays.ToString("0.00"))
       MsgBox(span.TotalHours.ToString("0.00"))
       MsgBox(span.TotalMinutes.ToString("0.00"))
---snip---

Regards,

Joergen Bech

>Can anybody assist me in fixing this code to return the number of days
>idfference
[quoted text clipped - 4 lines]
>
>i was expecting a return of 2 but get a return of 1 instead,  any suggstions.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.