Forum Moderators: open

Message Too Old, No Replies

Display Date in html page

How to display the date

         

woodyxx

3:21 am on Feb 22, 2004 (gmt 0)



BravoTwoZero, last July (2003), you asked the following:

Hi,
I am trying to display current date in my pure html page. I know how to display in asp or jsp page where I can get the server variable to display. I know Javascript does it for html but I am bit confused. Any suggestion?

Many Thanks

Bravo
=========================
Try using this code where you want the time and date to appear: <SCRIPT>document.write(Date())</SCRIPT>

...woody

jonathanleger

10:00 pm on Feb 25, 2004 (gmt 0)

10+ Year Member



Just paste this code whever you want the date to be displayed:


<script language=javascript>
var date = new Date();
var day = date.getDay();
var month = date.getMonth();
var year = date.getYear();
if (year < 1000)
{
year += 1900;
}
document.write(day + '/' + month + '/' + year);
</script>