Can Javascript generate a clock, from submit PHP submitted?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Can Javascript generate a clock, from submit PHP submitted?

Post by simonmlewis »

I need to show a clock (really simple one) to show the time of a booking.
So when it is submitted, it shows what is commonly seen as a clock (you seen them ticking on screen with second hand), but I don't want the second hand. I want it to just the hour and minute hand.

I could do it with a digital appearance using appropriate fonts, but be nice to do is a an analogue clock.

Is there a Javascript clock script, that can be altered to show the time based on a PHP variable?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
jdhmtl
Forum Newbie
Posts: 18
Joined: Tue Aug 12, 2014 7:33 am

Re: Can Javascript generate a clock, from submit PHP submitt

Post by jdhmtl »

Shouldn't be too difficult. What's the workflow here? User submits a booking, form posts, updates the DB, page is reloaded (or user redirected) and saved booking is shown with analogue clock to show the selected time? Either use time value straight from $_POST or send it to the new page if you're redirecting and pass that into whatever JS function sets the clock's time.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Can Javascript generate a clock, from submit PHP submitt

Post by simonmlewis »

Oh yes I get all that - easy peasey, but I cannot find a JS function that can do it, and be set to use a variable instead, and no minute time.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
jdhmtl
Forum Newbie
Posts: 18
Joined: Tue Aug 12, 2014 7:33 am

Re: Can Javascript generate a clock, from submit PHP submitt

Post by jdhmtl »

Is there a particular script you've looked at? Shouldn't be hard to tweak to your needs.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Can Javascript generate a clock, from submit PHP submitt

Post by simonmlewis »

No - I came here because all those I found are JS and I'm not a JS expert at all. Couldn't see how I would be able to adjust.

It needs to be as simple a clock as possible tho.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply