I want to run polls for a certain ammount of time.
how do I add the number of days to time() ??
time() + $days?
set day in future
Moderator: General Moderators
Code: Select all
<?php
$ts = time();
echo date('Y-m-d', $ts), "<br />\n";
$ts = strtotime('tomorrow');
echo date('Y-m-d', $ts), "<br />\n";
$ts = strtotime('+1 day');
echo date('Y-m-d', $ts), "<br />\n";
$ts = strtotime('+2 day');
echo date('Y-m-d', $ts), "<br />\n";
$ts = strtotime('+2 week');
echo date('Y-m-d', $ts), "<br />\n";
$ts = strtotime('next thursday');
echo date('Y-m-d', $ts), "<br />\n";
$ts = strtotime('next friday');
echo date('Y-m-d', $ts), "<br />\n";
?>