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 10,001 of 10,840    |
|    Dean Earley to All    |
|    Re: DateDiff giving wildly wrong values    |
|    06 Apr 06 13:58:01    |
   
   From: dean.earley@icode.co.uk   
      
   >> 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)   
   >   
   > Is StillDate a String or a Date ?   
      
   Its a Date variable (its value is correct).   
      
   > It looks as if you are trying to get seconds from midnight   
      
   Exactly.   
      
   >> 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"?   
   >   
   > Most likely a Locale problem   
      
   The locale settings don't appear to affect it in any way.   
   The failing machines are using the same locale as our test machines and   
   my devlopment machine.   
      
   Nor does timezone and the current date/time.   
      
   > If StillDate is a Date type then extract its bit after the decimal   
   > point and multiply by 24 * 60 * 60 to get seconds   
      
   That's ok in this case but it would be nice to know why its going wrong   
   in case we come across it again.   
      
   --   
   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