function date_time(id) {
date = new Date;
year = date.getFullYear();
month = date.getMonth();
months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
d = date.getDate();
day = date.getDay();
days = new Array('Sunday','Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
h = date.getHours();
suffix = 'AM';
if(h>=12) { suffix = 'PM'; }
if(h==0) { h = 12; }
if(h>12) { h = h-12; }
m = date.getMinutes();
if(m<10) { m = "0"+m; }
result = ''+days[day]+', '+months[month]+' '+d+', '+year+' '+h+':'+m+' '+suffix;
document.getElementById(id).innerHTML = result;
setTimeout('date_time("'+id+'");','1000');
return true;
}
<script type=”text/javascript” src=”http://www.yourwebsite.com/date_time.js”></script>
<div id=”date_time” style=”color:#333333; font-weight:bold; font-size:1em;”></div>
<script type=”text/javascript”>window.onload = date_time('date_time');</script>