نشان دادن زمانی که وارد صفحه شده اید
اين كد را در جاي مناسب كپي كنيد:
کد:
<!-- Start of Display Time -->
<!-- Displays the current system time to the visitor of your site -->
<!-- Instructions: Just put the beginning of this code inside your pages
'<head>' tags and the later part inside your pages '<body>' tags. -->
<!-- Script supplied with CoffeeCup HTML Editor -->
<!-- www.coffeecup.com -->
<head>
<script language="JavaScript">
<!--
var Temp;
setClock();
function setClock() {
CC_Time = "";
now = new Date();
var CurHour = now.getHours();
var CurMinute = now.getMinutes();
now = null;
if( CurHour > 12 ) {
CurHour = CurHour - 12;
ampm = 1;
}
else
ampm = 0;
if( CurHour == 0 )
CurHour = 12;
if( CurMinute < 10 )
CurMinute = "0" + CurMinute;
CurHour = "<FONT SIZE=2><B>" + CurHour + ":" + CurMinute + "</B>";
if( ampm == 1 )
CurHour = CurHour + " P.M.";
else
CurHour = CurHour + " A.M.";
Temp = CurHour;
}
function pathOnly (InString) {
LastSlash=InString.lastIndexOf ('/', InString.length-1)
OutString=InString.substring (0, LastSlash+1)
return (OutString);
}
// -->
</script>
<body>
<!-- Just insert the following code where you want the time to appear -->
<script>
document.write( Temp );
</script>
<!-- End Insert -->