note 27351 rejected from function.date by betz
| From: | betz@php.net | Date: | Tue, 03 Dec 2002 09:34:58 +0000 |
| Subject: | note 27351 rejected from function.date by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40290@lists.php.net to get a copy of this message | ||
Does anybody know how to create a timestamp of the current date+time that one can actually insert as
the second argument into the date() function? I've tried all these 4 and the don't work:
$t1 = date("U");
$t2 = time();
$t3 = date("YmdHis");
$t4 = date("Y-m-d H:i:s");
$current_date1 = date("Y-m-d", t1);
$current_date2 = date("Y-m-d", t2);
$current_date3 = date("Y-m-d", t3);
$current_date4 = date("Y-m-d", t4);
echo "current_date1=$current_date1, current_date2=$current_date2, ";
echo "current_date3=$current_date3, current_date4=$current_date4, ";
// will output: current_date1=1969-12-31, current_date2=1969-12-31,
// current_date3=1969-12-31, current_date4=1969-12-31,