Jump to content

Help the IDIOT please

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...