Jump to content

Help the IDIOT please


missschools
 Share

Recommended Posts

:) hey all i would like to add a digital clock that also display the date, to my site.I did find the action scrip for the digital clock's time but would like to add the date as follows as wel 27 Mar 2010 could someone please help me with this im brand new to this. the code i have for the time is as follows time=new Date(); // time objectvar seconds = time.getSeconds()var minutes = time.getMinutes()var hours = time.getHours()if (hours<12) {ampm = "AM";} else{ampm = "PM";}while(hours >12){hours = hours - 12;}if(hours<10){hours = "0" + hours;}if(minutes<10){minutes = "0" + minutes;}if(seconds<10){seconds = "0" + seconds;}clock_txt.text = hours + ":" + minutes + ":" + seconds +" "+ ampm; how do i alter this sothat the date is also displayed :):)
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...