Javascripts > Javascript Clocks > Text Time Format
Script Title: Text Time Format
Description: This script collects the current time from your computer and writes it to HTML format for the browser to display.
Example: Available
Credit: Script created by ATOJ
Copy the following code between the <BODY></BODY> tags of your html page.<script> /* This script collects the current time from your computer and writes it to HTML format for the browser to display. Script by http://www.atouchofjamaica.com More great scripts at http://www.java-scripts.net Place this script anywhere in the body of your HTML. */ atoj = new Date(); atoj1= atoj.getHours(); atoj2 = atoj.getMinutes(); atoj3= atoj.getSeconds(); if(atoj1==0){atoj4=" AM";atoj1=12} else if(atoj1 <= 11){atoj4=" AM"} else if(atoj1 == 12){atoj4=" PM";atoj1=12} else if(atoj1 >= 13){atoj4=" PM";atoj1-=12} if(atoj2 <= 9){atoj2="0"+atoj2} document.write(""+atoj1+":"+atoj2+":"+atoj3+"<b>"+atoj4+"</b>"+""); </script>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email