F
Fran?ois Laroche
hey guys, I know that you will tell me that's easier to do in php or
even in asp, but I just dont have the time to learn it
1- I need a javascript that will show the date of tomorrow
2- I need a javascript that will show the date in 2 days
actually I have a script that show me the current date....
there it is:
<script>
var dayarray=new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi")
var montharray=new Array("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre")
function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var cdate="<small><font color='000000'
face='Arial'><b>"+dayarray[day]+" "+daym+" "+montharray[month]+"
"+year+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1)
}
</script>
<span id="clock"></span>
For example, I want it to show:
Monday, May 03, 2004(current date)
Tuesday, May 04, 2004
Wednesday, May 05, 2004
I need it in javascript plz
Thx for your help.
-Frank
even in asp, but I just dont have the time to learn it
1- I need a javascript that will show the date of tomorrow
2- I need a javascript that will show the date in 2 days
actually I have a script that show me the current date....
there it is:
<script>
var dayarray=new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi")
var montharray=new Array("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre")
function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var cdate="<small><font color='000000'
face='Arial'><b>"+dayarray[day]+" "+daym+" "+montharray[month]+"
"+year+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1)
}
</script>
<span id="clock"></span>
For example, I want it to show:
Monday, May 03, 2004(current date)
Tuesday, May 04, 2004
Wednesday, May 05, 2004
I need it in javascript plz
Thx for your help.
-Frank