Forum Moderators: open
Then I have a javascript that displays a running clock on my page.
Question: How can I pass the variable value (from PHP) to my Javascript so that the variable value will be the initial value for my javascript?
<script type="text/javascript">var startTime = '<?php echo date("Y-m-d H:i:s"); ?>';alert(startTime); // for testing only</script>