I have an entry form that allows users to enter a competition.
We run this competition every monday 12.00 midnight. Rule is if the user has entered this week competition, they need to wait for next Monday to be allowed to enter competition again.
date_default_timezone_set('GMT');
$today = date("m.d.y H:i:s");
echo strtotime("last Monday");
This is what has been done now I know it's nothing important but I have two questions:
Why does
strtotime("last Monday");
return1398643200
?How do I do the calculation? (Entries all have
DATETIME
field.)