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,556 of 10,840    |
|    Auric__ to Steve    |
|    Re: Date Time Difference...    |
|    28 Dec 07 14:39:33    |
   
   From: not.my.real@email.address   
      
   On Fri, 28 Dec 2007 01:54:02 GMT, Steve wrote:   
      
   > I was wondering if someone could help me here. Since I'm running   
   > and iMac, I don't have Visual Basic (6) installed. I want a small   
   > function returns the number of seconds between two dates.   
   >   
   > Can anyone help me with this? I would appreciate it.   
      
   Dim result As Long, day1 As Date, day2 As Date   
   day1 = Now   
   day2 = Now - 1   
   result = DateDiff("s", day1, day2)   
      
   ' If you always want a positive number, then:   
   result = Abs(DateDiff("s", day1, day2))   
      
   --   
   Talking to you is like talking to an omelet at times.   
      
   --   
   Posted via a free Usenet account from http://www.teranews.com   
      
   --- 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