Jump to content

Date


Mick Wansey
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...