home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,999 of 10,840   
   Dean Earley to Dean Earley   
   Re: DateDiff giving wildly wrong values   
   06 Apr 06 11:43:12   
   
   From: dean.earley@icode.co.uk   
      
   Dean Earley wrote:   
   > I have the following code to get the number of seconds into a day given   
   > a date/time value:   
   >   
   > TValS = DateDiff("s", DateValue(StillDate), StillDate)   
   >   
   > StillDate is #04/05/2006 21:03:52#, and DateValue is correct at   
   > #04/05/2006# yet TValS is giving me -2429768 (Yes, negative 2.4 million)   
   >   
   > This only occurs on 3 machines we've seen so far (none we have direct   
   > access to)   
   > Has anyone ever seen anything like this before or can point to a   
   > particular hardware "feature"?   
      
   Interestingly, this number is CORRECT for:   
   ?DateDiff("s", #05/04/2006#, #04/05/2006 21:03:52#)   
   -2429768   
      
   Notice the day/month parts being swapped...   
   MSDN does say it expects a string but can handle "any expression that   
   can represent a date, a time, or both a date and time" but as StillDate   
   is typed as a Date, I'd expect this to be unambiguous.   
      
   --   
   Dean Earley (dean.earley@icode.co.uk)   
   i-Catcher Development Team   
      
   iCode Systems   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca