Jump to content

Relógio


joven

Recommended Posts

Boas

deixo o código que já fiz.

<body>
<p align="center"><font color="#000000" size="5"><strong>Hora/Data Configuração </strong></font></p>
<FORM METHOD=GET>
<p> </p>
<form id="form1" name="form1" method="post" action="">
  <label>
    <div align="center">

      <p align="center"> 
    <script type="text/javascript">
	<!--
	var currentTime = new Date()
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	var hour = currentTime.getHours()
	var minutes = currentTime.getMinutes()
	var seconds = currentTime.getSeconds()
	if (minutes < 10)
	minutes = "0" + minutes
	if (seconds < 10)
	seconds = "0" + seconds

	%document.write(month + "/" + day + "/" + year + " - " + hour + ":" + minutes + ":" + seconds)
	var txt = month + "/" + day + "/" + year + " - " + hour + ":" + minutes + ":" + seconds

	//-->
        </script> 
	<input name="textfield" type="text" value="txt">
  </p>
  <p align="center"> </p>
      <div align="center">
      <p><input type="submit" name="Submit" value="Submit" /></p>
  </div>
</form>
</body>
</html>

A página tem que ser pequena para puder caber num microcontrolador que a vai servir, o máximo que já testei foi 1400 letras.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.