Hellusius Posted August 4, 2006 Share Posted August 4, 2006 I made a little date script as you can see:[code]<script language="JavaScript"><!-- scriptvar date=new Date();var day=date.getday();var month=date.getMonth()+1;var year=date.getFullYear();document.write("The Date is:"+Day+" - "+month+" - "+year+");// script --></script> [/code]The problem is, that it doesn't show, and I don't see what I did wrong either. Quote Link to comment https://forums.phpfreaks.com/topic/16539-does-not-show/ Share on other sites More sharing options...
nogray Posted August 4, 2006 Share Posted August 4, 2006 Javascript is case senstive, so your getday() function should be getDay() and in the document.write, the Day should be day. Also, there is an extra " after the year[code]<script language="JavaScript"><!-- scriptvar date=new Date();var day=date.getDay();var month=date.getMonth()+1;var year=date.getFullYear();document.write("The Date is:"+day+" - "+month+" - "+year);// script --></script> [/code] Quote Link to comment https://forums.phpfreaks.com/topic/16539-does-not-show/#findComment-69272 Share on other sites More sharing options...
Hellusius Posted August 4, 2006 Author Share Posted August 4, 2006 Thanks for the header, forgot those, btw how can I put a 0 before it if it lower than 10, do I need a make an if/then/else for it or is there a shorter way? Quote Link to comment https://forums.phpfreaks.com/topic/16539-does-not-show/#findComment-69319 Share on other sites More sharing options...
nogray Posted August 4, 2006 Share Posted August 4, 2006 if/else will do just fine, just remmeber to put the 0 in quotes "0" so it's a string and not a number. Quote Link to comment https://forums.phpfreaks.com/topic/16539-does-not-show/#findComment-69330 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.