View Full Version : Is there a HTML code that makes it so that you get the time and date displayed?


tommy_t
08-26-2005, 02:25 PM
Self explanatory: Is there a HTML code that makes it so that you get the time and date displayed? If so are there also different ways of making it display the time and date? Like 26/8/2005 or 26th August 2005, etc.?




Help will be much appreciated...,
Tom

Douglas
08-26-2005, 04:37 PM
nope i have never seen it.. you can use javascript:

<script language="JavaScript" type="text/javascript">
<!--;
var d=new Date();
var hrs=d.getHours();
var min=d.getMinutes();
var sec=d.getSeconds();
if (hrs > 12) {
hrs=hrs-12;
}
if (min < 10) {
min="0"+min;
}
if (sec < 10) {
sec="0"+sec;
}
document.write("The time is: "+hrs+":"+min+":"+sec);
//-->
</script>