can you get millisecond from TimeOfDay??? 
Author Message
 can you get millisecond from TimeOfDay???

so if TimeOfDay doesn't return time in milliseconds how can I get it?
am I doomed to use

TimeOfDate & " " & Now.Milliseconds



Sat, 29 Jan 2005 02:21:35 GMT  
 can you get millisecond from TimeOfDay???
Try this:

MessageBox.Show(DateTime.Now.ToString("H:m:s.fff",
System.Globalization.DateTimeFormatInfo.InvariantInfo))

--
Robert Chapman
Manager, Applications Development
prairieFyre Software Inc.
http://www.prairiefyre.com

Quote:
> so if TimeOfDay doesn't return time in milliseconds how can I get it?
> am I doomed to use

> TimeOfDate & " " & Now.Milliseconds



Sat, 29 Jan 2005 02:34:24 GMT  
 can you get millisecond from TimeOfDay???
Thanks that works... NOTE TO MS:  seems verbose for so a simple a thing...


Quote:
> Try this:

> MessageBox.Show(DateTime.Now.ToString("H:m:s.fff",
> System.Globalization.DateTimeFormatInfo.InvariantInfo))

> --
> Robert Chapman
> Manager, Applications Development
> prairieFyre Software Inc.
> http://www.prairiefyre.com


> > so if TimeOfDay doesn't return time in milliseconds how can I get it?
> > am I doomed to use

> > TimeOfDate & " " & Now.Milliseconds



Sat, 29 Jan 2005 03:06:12 GMT  
 can you get millisecond from TimeOfDay???


Quote:
> so if TimeOfDay doesn't return time in milliseconds how can I get it?
> am I doomed to use

> TimeOfDate & " " & Now.Milliseconds

Why do you need to use TimeOfDay, instead of Now?

Realistically, they both get their info from the same place.  Now is
ReadOnly, but I would presume that you don't really need a writable
TimeOfDay...or do you?

Am I missing a prior conversation?

*************

This posting is provided "AS IS" with no warranties, and confers no rights.



Sat, 29 Jan 2005 07:25:36 GMT  
 can you get millisecond from TimeOfDay???
You just wanted to know why
           Now.ToString( )
doesn't give you the milliseconds, yes?

Sorry about that.

I think it is historical.  Left over from many many versions of COM that,
when converting a Date variant (a VB Date data type), converted to hh:mm:ss
only.

I think if the default was changed now, there would be a lot more people
complaining than people, such as yourself, jubilating.  (This is 100% a
personal opinion.  Not an official comment.  If you want a method added that
returns milliseconds, as well, then put in a feature request.)

I might note that doing  Now.ToString & "." & Now.Millisecond will *NOT*
work, since if there are fewer than 100 milliseconds you won't get 0
padding.

Sorry about the first answer.  How come I always "get it" *after* I've hit
SEND.  Sigh.

Bill Wilkinson
*************

This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:



> > so if TimeOfDay doesn't return time in milliseconds how can I get it?
> > am I doomed to use

> > TimeOfDate & " " & Now.Milliseconds

> Why do you need to use TimeOfDay, instead of Now?

> Realistically, they both get their info from the same place.  Now is
> ReadOnly, but I would presume that you don't really need a writable
> TimeOfDay...or do you?

> Am I missing a prior conversation?

> *************

> This posting is provided "AS IS" with no warranties, and confers no
rights.



Sat, 29 Jan 2005 07:38:02 GMT  
 can you get millisecond from TimeOfDay???

Quote:
> so if TimeOfDay doesn't return time in milliseconds how can I
> get it? am I doomed to use

> TimeOfDate & " " & Now.Milliseconds

TimeOfDay does return milliseconds.

Try
    msgbox now.timeofday.tostring

Armin



Sat, 29 Jan 2005 18:12:59 GMT  
 can you get millisecond from TimeOfDay???
On my machine,
      timeofday.tostring( )
does *not* return milliseconds.  I couldn't change my "regional preferences"
to get milliseconds, but I wouldn't be surprised if there is a setting that
does this.

But if you will distribute your program to various machines, you probably
wouldn't wan to depend upon local preferences, in any case.

Bill Wilkinson
*************

This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:

> > so if TimeOfDay doesn't return time in milliseconds how can I
> > get it? am I doomed to use

> > TimeOfDate & " " & Now.Milliseconds

> TimeOfDay does return milliseconds.

> Try
>     msgbox now.timeofday.tostring

> Armin



Sun, 30 Jan 2005 05:06:42 GMT  
 can you get millisecond from TimeOfDay???

Quote:
> On my machine,
>       timeofday.tostring( )
> does *not* return milliseconds.  I couldn't change my "regional
> preferences" to get milliseconds, but I wouldn't be surprised if
> there is a setting that does this.

> But if you will distribute your program to various machines, you
> probably wouldn't wan to depend upon local preferences, in any
> case.

When I write

    Debug.Write(Now.TimeOfDay.ToString)
I get

    03:19:03.5319856

That's all I currently can say.

Armin



Sun, 30 Jan 2005 09:25:51 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Getting milliseconds

2. Getting Milliseconds in VB4

3. Getting milliseconds

4. Getting time in milliseconds

5. Q: Getting system clock info- in milliseconds?

6. Getting milliseconds

7. Getting timestamp with milliseconds

8. monthCalendar1.SelectionStart.Date + dtpTime.Value.TimeOfDay = ERROR

9. How do I create a canned form?

10. Canned AcctReceivable Module needed!

11. Canned pages....

12. Cans access2.0 engine access btrieve files?

 

 
Powered by phpBB® Forum Software