Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <link rel="stylesheet" type="text/css" href="left_side.css" />
- <script language="JavaScript">
- function checklength(i){
- if (i<10)
- {i="0"+i;}
- return i;
- }
- function clock(){
- var now = new Date();
- var hours = checklength(now.getHours());
- var minutes = checklength(now.getMinutes());
- var seconds = checklength(now.getSeconds());
- var format = 0; //0=24 hour format, 1=12 hour format
- var time;
- if (format == 1){
- if (hours >= 12){
- if (hours ==12){
- hours = 12;
- }else {
- hours = hours-12;
- }
- time=hours+':'+minutes+':'+seconds+' PM';
- }else if(hours < 12){
- if (hours ==0){
- hours=12;
- }
- time=hours+':'+minutes+':'+seconds+' AM';
- }
- }
- if (format == 0){
- time= hours+':'+minutes+':'+seconds;
- }
- document.getElementById("clock").innerHTML=time;
- setTimeout("clock();", 500);
- }
- </script>
- </head>
- <body>
- <div id="sts2"><small><small><div id="clock"><script language="javascript">clock();</script></div></small></small></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement