이 코드를 살펴보고이 수요일 완벽하게 작동이 가능 있다는 것입니다,하지만 얼마나 말해주십시오 화요일에게 :PHP strtotime bug?
이<?php
$current_time = strtotime('now');
if ($current_time > strtotime('tuesday this week 8:45pm') && $current_time < strtotime('tuesday this week 11:45pm')) {
$background = 1;
}
if ($current_time > strtotime('wednesday this week 8:45pm') && $current_time < strtotime('wednesday this week 11:45pm')) {
$background = 1;
}
else{
$background = 0;
}
?>
<script>
var backday = <?php echo json_encode($background); ?>;
</script>
화요일를 들어, 0을 반환하지만 수요일 것이로, 1을 반환 그것은해야한다. 왜?
설정 한 시간대에 따라 다릅니다. 나에게 그들은 모두 0을 반환해야한다. –
화요일에 실행될 때 이것이 작동하지 않는다는 것을 의미한다고 가정 하겠지만 시간 사이에는 수요일에 실행될 때 작동합니까? – ajon
이 서버를 실행할 때 서버 (로컬이 아님) 시간은 무엇입니까? –