Define date boundaries in PHP
<p>I used some date functions surrounding the French Republic of 1792-1806. But I want to know if the (PHP8) date functions can handle these dates. </p>
<pre class="brush:php;toolbar:false;">function CheckFrDate($CheckDate){
$BeginFrDate = date_create_from_format('d/m/Y', '22/09/1792');
$EndFrDate = date_create_from_format('d/m/Y', '22/09/1806');
if (
$CheckDate->getTimestamp() > $BeginFrDate->getTimestamp() &&
$CheckDate->getTimestamp() < $EndFrDate->getTimestamp()){
return 1;
}else{
return -1;
}
}</pre>
<p>So a date like September 23, 1793 should be fine. But my function keeps returning false. </p>