missschools 0 Posted June 12, 2010 Report Share Posted June 12, 2010 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 Quote Link to post Share on other sites
End User 0 Posted June 12, 2010 Report Share Posted June 12, 2010 (edited) Edit: My mistake, for some reason I thought I was in the JS forum. Edited June 12, 2010 by End User Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.