Jump to content

Date


fruzzgle

Recommended Posts

This isn't much but I couldn't find anything that would show you the updated time without refreshing the browser. What I mean by this, I have the following code (very simple, this is just a test I'm doing after looking at a date tutorial).

[code]<?php
echo(date("l h:i:s a"));
?>[/code]

This shows you the day of the week and the hour, minut, seconds and either am or pm .

Example: Monday 06:54:49 pm

But to see what time it is you need to refresh the page to see the updated time. How do I make it so you don't have to refresh and your see the time go

Monday 06:54:49 pm
Monday 06:54:50 pm
Monday 06:54:51 pm
Monday 06:54:52 pm

And so on. I explained it the best I could but if you don't know what I'm talking about I'll try to re-explain it.
Link to comment
https://forums.phpfreaks.com/topic/10723-date/
Share on other sites

Hi fruzzgle

I'm pretty new to php myself and have been hunting down a good php resource site for a while - looks like I found one :)

Anyway, I see your post and notice that noone has replied as yet so I figure I'd have a bash myself. I've only been learning php for about 2 weeks now but I've not yet come across a way to do what you want without using Javascript.

Not sure if I'm allowed to post this so if not, an admin may remove it, but you could try [a href=\"http://www.dynamicdrive.com/dynamicindex6/index.html\" target=\"_blank\"]This[/a] link.
Link to comment
https://forums.phpfreaks.com/topic/10723-date/#findComment-40040
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.