dulciew
10-15-2002, 04:49 AM
I have a book which tells me to use the following code to create a date:
var tNow=new Date()
var tlocDate=tNow.toLocaleString()
var tDate=tlocDate.substring(0,10)
document.write("Welcome, today is " +tDate+)
and the date should display in Internet Explorer as follows:
10/15/2002
but it comes out:
Tuesday 1
instead.
I know there are lots of ways to display the date, but my question is why does it appear with the day in full, instead of the short date.
Can anyone help.
Also, I have seen the date something like:
today=new Date(dd/mm/yyyy)
but I can't get this to work either.
Help Please.
:confused:
var tNow=new Date()
var tlocDate=tNow.toLocaleString()
var tDate=tlocDate.substring(0,10)
document.write("Welcome, today is " +tDate+)
and the date should display in Internet Explorer as follows:
10/15/2002
but it comes out:
Tuesday 1
instead.
I know there are lots of ways to display the date, but my question is why does it appear with the day in full, instead of the short date.
Can anyone help.
Also, I have seen the date something like:
today=new Date(dd/mm/yyyy)
but I can't get this to work either.
Help Please.
:confused: