Jump to content

Help the IDIOT please


missschools

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

Archived

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

×
×
  • Create New...