Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Milliseconds Conversion


Message #1 by "Robert Gray" <rmggray@h...> on Tue, 13 Feb 2001 19:09:45
=shrug

As I said, it was offhand, but thanks.  Haven't worn the VB hat in a while
ao I didn't really think about '/' versus '\'



------------------------------------------
Christopher Tacke, MCSD
Rubicon Technologies
(xxx)xxx-xxxx


> -----Original Message-----
> From: Peter Conrey [mailto:pconrey@t...]
> Sent: Tuesday, February 13, 2001 6:08 PM
> To: professional vb
> Subject: [pro_vb] RE: Milliseconds Conversion
>
>
> Almost.
>
>     	Debug.Print "Time = " & days & ", " & hours & ", " & minutes & ", "
> & seconds
>
> will give you:
>
> 	Time = 6.37068243055556, 8.89637833333333, 53.7827, 46.962
>
> You have to turn your slashes around ("\") if you want:
>
> 	Time = 6, 8, 53, 46
>
>
> Peter Conrey
> Sr. Programmer/Analyst
> Transaction Graphics, Inc.
>  (xxx) xxx-xxxx
>
>
> -----Original Message-----
> From: Christopher Tacke [mailto:ctacke@r...]
> Sent: Tuesday, February 13, 2001 1:38 PM
> To: professional vb
> Subject: [pro_vb] RE: Milliseconds Conversion
>
>
> Offhand isn't it as simple as this?
>
> <vbcode>
> Dim days, hours, minutes, seconds, millisecs
>
> Millisecs = {insert code here to retrieve your time}
> days = Millisecs / 86400000 'milliseconds in a day
> Millisecs = Millisecs Mod 86400000 'leftovers
> hours = Millisecs / 3600000 'milliseconds in an hour
> Millisecs = Millisecs Mod 3600000 'leftovers
> minutes = Millisecs / 60000 ' milliseconds in a minute
> Millisecs = Millisecs Mod 60000 'leftovers
> seconds = Millisecs / 1000 'milliseconds in a second
> Millisecs = Millisecs Mod 1000 'remaining milliseconds
> </vbcode>
>
> ------------------------------------------
> Christopher Tacke, MCSD
> Rubicon Technologies
> (xxx)xxx-xxxx
>
>
> > -----Original Message-----
> > From: Robert Gray [mailto:rmggray@h...]
> > Sent: Tuesday, February 13, 2001 7:10 PM
> > To: professional vb
> > Subject: [pro_vb] Milliseconds Conversion
> >
> >
> > I've been asked to create a routine that, when run on a PC or
> > Network File Server, will return
> > how long it has been since that PC or File Server has been rebooted.
> >
> > I know I can get this information, in milliseconds, from the
> > GetTickCount API call, but what I
> > don't know how to do is convert the milliseconds into
> Days/Hours/Minutes.
> >
> > Does anyone have a routine that will do this?
> 

  Return to Index