This topic is locked

Date Stamp & Live Clock

9/9/2008 9:32:25 AM
PHPRunner General questions
L
Lisa2006 author

Hi Forum,
Foods for thought!!!
Most reputable website's today have a date stamp and a live time displayed. Think this would be a great feature for future builds of PHPRunner.
Does anyone know how or can supply code to achieve this. Naturally, the date and time would need to be pulled from the server and NOT the client machine.
Ideal format would be as follows:
Tuesday, 9th Sept 2008 14:30
Thanks in advance
Lisa

Admin 9/9/2008

Use "Insert PHP code snippet" function in Visual Editor and format current date/time the way you need it.

echo date("F j, Y, g:i a");


More info:

http://www.php.net/date

L
Lisa2006 author 9/10/2008

Use "Insert PHP code snippet" function in Visual Editor and format current date/time the way you need it.


echo date("F j, Y, g:i a");


More info:

http://www.php.net/date


Thanks for the reply.
Whilst the solution displays the date and time, it is static. I need to display the time in a way that will be live. I.e. you can see the seconds increment, minutes increment, etc. without having to refresh the screen.
Can anyone provide a solution.
Thanks in advance
Lisa

Admin 9/10/2008

You need to find an example on the web that does this and paste it to your page.
Please note that "live" clock is implemented with Javascript help which means it displays client time.

S
steveh 9/10/2008

When you generate that javascript you could get it to add elapsed seconds onto the date/time from the server, it may be a second or so out by the time the page has built but it won't be wildly out like a client clock could be.

L
Lisa2006 author 9/10/2008

When you generate that javascript you could get it to add elapsed seconds onto the date/time from the server, it may be a second or so out by the time the page has built but it won't be wildly out like a client clock could be.


Thanks for your comments.
Anyone have any good links to obtain sample code?
Lisa