set day in future
Posted: Sun Sep 17, 2006 5:32 pm
I want to run polls for a certain ammount of time.
how do I add the number of days to time() ??
time() + $days?
how do I add the number of days to time() ??
time() + $days?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
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";
?>