Page 1 of 1

Can Javascript generate a clock, from submit PHP submitted?

Posted: Wed Aug 27, 2014 8:25 am
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?

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

Posted: Wed Aug 27, 2014 8:55 am
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.

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

Posted: Wed Aug 27, 2014 9:02 am
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.

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

Posted: Wed Aug 27, 2014 9:04 am
by jdhmtl
Is there a particular script you've looked at? Shouldn't be hard to tweak to your needs.

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

Posted: Wed Aug 27, 2014 9:08 am
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.