Jump to content

Date


Mick Wansey

Recommended Posts

Is there anything wrong with this code when i view it in a browser it comes out in h1 size how do I make it smaller tymonthNames = ["January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December"];dayNames = ["Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday"];function customDateString(oneDate) {var theDay = dayNames[oneDate.getDay()];var theMonth = monthNames[oneDate.getMonth()];var theYear = oneDate.getFullYear();return theDay + ", " + theMonth + " " + oneDate.getDate + ", " + theYear;}<script type="text/javascript">document.write(customDateString(new Date()))</script>

Link to comment
Share on other sites

You probably have those script tags inside an element with large font size.A server-side language like PHP would be a better option to display a date on the page.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...