473,322 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Display time and include milliseconds

Ren
Hi all,

I am trying to display the current time including milliseconds (two digits
only). So for example the current time will have Hour : Minute : Second :
Millisecond.

Example: 15:25:05:03 (This would represent 3:25pm)

Just to clarify the millisecond will be similar to what is shown on a
stopwatch. So once you get past 99 milliseconds the second will go up by 1.

Does anyone know how to display this in php?

Thanks
Ren
Feb 23 '06 #1
4 32801
Ren said the following on 23/02/2006 15:39:
Hi all,

I am trying to display the current time including milliseconds (two digits
only). So for example the current time will have Hour : Minute : Second :
Millisecond.

Example: 15:25:05:03 (This would represent 3:25pm)

Just to clarify the millisecond will be similar to what is shown on a
stopwatch. So once you get past 99 milliseconds the second will go up by 1.


So you actually mean hundredths of a second?

You can get the fractional time using microtime().
--
Oli
Feb 23 '06 #2
Ren
Ok i meant hundredths of a second. How do i do this using microtime()????
"Oli Filth" <ca***@olifilth.co.uk> wrote in message
news:M8******************@newsfe7-win.ntli.net...
Ren said the following on 23/02/2006 15:39:
Hi all,

I am trying to display the current time including milliseconds (two
digits only). So for example the current time will have Hour : Minute :
Second : Millisecond.

Example: 15:25:05:03 (This would represent 3:25pm)

Just to clarify the millisecond will be similar to what is shown on a
stopwatch. So once you get past 99 milliseconds the second will go up by
1.


So you actually mean hundredths of a second?

You can get the fractional time using microtime().
--
Oli

Feb 23 '06 #3
Ren said the following on 23/02/2006 16:23:
Ok i meant hundredths of a second. How do i do this using microtime()????


Read the manual for microtime(). I'm sure it will give you a clue...
--
Oli
Feb 23 '06 #4
Ren wrote:
Ok i meant hundredths of a second. How do i do this using microtime()????
"Oli Filth" <ca***@olifilth.co.uk> wrote in message
news:M8******************@newsfe7-win.ntli.net...
Ren said the following on 23/02/2006 15:39:
Hi all,

I am trying to display the current time including milliseconds (two
digits only). So for example the current time will have Hour : Minute :
Second : Millisecond.

Example: 15:25:05:03 (This would represent 3:25pm)

Just to clarify the millisecond will be similar to what is shown on a
stopwatch. So once you get past 99 milliseconds the second will go up by
1.


So you actually mean hundredths of a second?

You can get the fractional time using microtime().
--
Oli



Please do not top-post,,

http://us3.php.net/manual/en/function.microtime.php has many examples of
how to use microtime() This, with the DATE() function may give you what
you want....
Feb 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Paul LeBlanc | last post by:
I have some images that move positions fine using onmousedown or onmousemove to feed a function the coordinates. It doesn't work when I plug it into conditional loops with setTimeout to set the...
8
by: Yves PEYSSON | last post by:
Hi, I want to display the same image (from the same file) at different positions in a window. Up to now I used DIV command in the body part of the text, and document.getElementById in order to...
10
by: Partho Choudhury | last post by:
Hi all: I need to add a snippet which access the system time (upto atleast milliseconds) using ANSI std. C++. I cannot use MFC and Win32 APIs in my program for now for various reasons. Is there...
26
by: Pravesh | last post by:
Hi: is there a way to get current system time in milliseconds... which functions and headers?? thanks pravesh
5
by: sandman | last post by:
I've been testing my web app on another workstation to simulate using the server time. The test pc's time is an hour behind the server time and when the user processes a request, the server time...
175
by: Ken Brady | last post by:
I'm on a team building some class libraries to be used by many other projects. Some members of our team insist that "All public methods should be virtual" just in case "anything needs to be...
9
by: HL | last post by:
I am using VS 2005 Beta - C# Problem: The Timer fires a few milliseconds before the actual Due-Time Let's say a timer is created in the following manner: System.Threading.Timer m_timer = null;...
7
by: Saurabh | last post by:
Hi , i am working with g++ on Linux.is there a way in C++ to get current time in milliseconds.( <ctime> provides accuracy upto seconds). I googled for it,searched the newsgroup but couldnt...
5
by: pedro.ballester | last post by:
Hi everyone, I am struggling with the following problem. I would like to measure the wall clock time required to run a section of the code with a precision of milliseconds. The attached code...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.