Live clock javascript starts from my custom time
- by newworroo
I was trying to create a live/dynamic clock is based on my custom time instead of system time.
There are many scripts, but I couldn't find the clock starts from my custom time.
Here is an example that I'm trying to modify. The problem is the seconds doesn't change, and it looks like I need to use ajax. Is there any way to do it without ajax? If not, help me to do it using ajax!!! The reason I don't like ajax method is that another page should be called and refreshed, so it will eat server ram.
ex)
http://www.javascriptkit.com/script/cut2.shtml
Before:
<script>
function show(){
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
...
...
After:
<script>
function show(){
var Digital=new Date()
var hours=<?php echo $hr; ?>;
var minutes=<?php echo $min; ?>;
var seconds=<?php echo $sec; ?>;
...
...