- الكود:
-
<div style="text-align: center;"><CENTER>
<SCRIPT LANGUAGE="JavaScript">
/* html
*********************************************************/
<!-- Begin
Stamp = new Date();
document.write('<font size="2" face="Arial"><B>' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear() + '</B></font><BR>');
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " P.M ";
}
else {
Time = " A.M ";
}
if (Hours > 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}
document.write('<font size="2" face="Arial"><B>' + Hours + ":" + Mins + Time + '</B></font>');
// End -->
</SCRIPT>
</CENTER><br></div>
المصدر :: اكواد جافا سكريبت وهتمل - javascript and Html Cods
عدل سابقا من قبل Ahmad SaȜed في 12.08.11 8:06 عدل 1 مرات