I need a function that makes it possible, like in C++ and
Java, to return the number of milliseconds since January 1
1970. Does this function exist in VB and if so, how do I
use it?
Thanks in advance,
Thomas Regin.
> I need a function that makes it possible, like in C++ and
> Java, to return the number of milliseconds since January 1
> 1970. Does this function exist in VB and if so, how do I
> use it?
The most granular you can get with VB is seconds, so you could multiply that
by 1000, but you won't be in control of the last 3 digits.
Print (CDbl(Now - CDate("01/01/1970")) * 24 * 60 * 60 * 1000)
but this is only accurate to 1 second. It always returns a number that wnds
in 3 zeros. You could use something like this in combination with an API
call such as timeGetTime:
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
which returns the current sustem time in milliseconds.
Hope this helps.
Steve
"Thomas Regin" <t...@thomas-regin.com> wrote in message
news:058001c1dfd7$21ea7220$19ef2ecf@tkmsftngxa01...
Thomas Regin
>.
>
> I need a function that makes it possible, like in C++ and
> Java, to return the number of milliseconds since January 1
> 1970. Does this function exist in VB and if so, how do I
> use it?
And I suppose you're going to want the answer RightNow, huh?
URL:http://groups.google.com/groups?selm=%23kmFSP1tBHA.2676%40tkmsftngp04
URL:http://groups.google.com/groups?selm=eIFcts0qBHA.2080%40tkmsftngp03
msec = (rightnow - #01/01/1970 00:00:00#) * 1000 / (#00:00:01# - #00:00:00#)
--
Joe Foster <mailto:jlfoster%40znet.com> Sacrament R2-45 <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!
I hope you understand that precision and accuracy
are significantly different commodities...
Bob
--
posting from work, but representing only myself
> Thomas Regin wrote:
> >
> > Thank you very much to both of you!! I got my problem
> > solved!
> I hope you understand that precision and accuracy
> are significantly different commodities...
...but *this* one goes to ELEVEN!!!1!
--
Joe Foster <mailto:jlfoster%40znet.com> Wanna buy a Bridge? <http://xenu.net/>
Yeah, and I literally *wasted* two months of my life trying to
write a stopwatch app with mere 0.003 second accuracy.
Simply can not be done with Windows, period.
(well, I suppose maybe it could in CE - the only thing
from MS ever to have even half-decent RTOS features.)
> Joe "Nuke Me Xemu" Foster wrote:
> >
> > "Bob O`Bob" <b...@cluestick.org> wrote in message <news:3CB377...@cluestick.org>...
> > > I hope you understand that precision and accuracy
> > > are significantly different commodities...
> >
> > ...but *this* one goes to ELEVEN!!!1!
>
>
> Yeah, and I literally *wasted* two months of my life trying to
> write a stopwatch app with mere 0.003 second accuracy.
>
> Simply can not be done with Windows, period.
> (well, I suppose maybe it could in CE - the only thing
> from MS ever to have even half-decent RTOS features.)
What! Windows NT/XP Embedded isn't where you want to go today?
Say it ain't so! Why, 640 XP ought to be enough for anybody...
--
Joe Foster <mailto:jlfoster%40znet.com> Space Cooties! <http://www.xenu.net/>