23-03-26, 10:43 PM
PHP كود :
<!DOCTYPE html>
<html>
<head>
<title>تنبيه حسب الوقت</title>
</head>
<body>
<script>
// الوقت بصيغة 24 ساعة (HH:MM)
let startTime = "14:30";
let endTime = "16:00";
function checkTime() {
let now = new Date();
let currentHours = now.getHours();
let currentMinutes = now.getMinutes();
let currentTime = currentHours * 60 + currentMinutes;
let startParts = startTime.split(":");
let endParts = endTime.split(":");
let start = parseInt(startParts[0]) * 60 + parseInt(startParts[1]);
let end = parseInt(endParts[0]) * 60 + parseInt(endParts[1]);
if (currentTime >= start && currentTime <= end) {
alert("الوقت ضمن الفترة المحددة!");
}
}
setInterval(checkTime, 60000);
checkTime();
</script>
</body>
</html>


![[صورة مرفقة: 177461173141861.gif]](https://up6.cc/2026/03/177461173141861.gif)