Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format for milliseconds

Status
Not open for further replies.

RiverGuy

Programmer
Jul 18, 2002
5,011
US
I can't remember....I tried format(now, "ms"), but that's not it....Anyone know?

Thanks.
 
Wot is it that u r going to do by convertig now to milliseconds? u just cant convert a date in to milliseconds.. may be u r lookin for a time interval?? if yes, tell us, may be we can help... All the Best
Praveen Menon
pcmin@rediffmail.com
 
I guess I was thinkin of SQL or something. Maybe I can pass a query off to the server to get them then to use in my program.
 

I think you will have to use a stored procedure to get what you want because I belive that the GETDATE() SQL function will only return down to seconds to VB. I think that you will have to cast the value returned to a string to get the milliseconds (Could be wrong).

Good Luck

 
Nah, I'll convert it to an integer before I get the result set and return the integer -- which will be my milliseconds. Either that or return both the minutes and milliseconds as integers from SQL.
 
"PC" clocks are not accurate to the millisecond level (actually they are not normally accurate even to the second in many situations). Setting / displaying or virtually ANY use of the internal 'clock' processes is just gilding the already wilted lilly. If these is some REALLY REALLY REALLY necessary function which actually benefits from timing at that level, you will need to have a third party add-on which includes an independent 'clock' - and use a GREAT DEAL OF CARE in obtaining the clock information for the timing functions. After all, Win is "MULTITASKING", so your timing may easily be affected by other processes.

I have seen situations where servers on the same networks were synchronized on a daily basis and ended the day with several seconds difference in the server clocks - even on 'slow days'. On my current system (just four older machines on a peer-to-peer network at home), I generally get an offset of at least a minute per week in my clock between the two or three running computers.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top