note 27351 added to function.date
| From: | php-general at lists dot php dot net | Date: | Tue, 03 Dec 2002 01:06:37 +0000 |
| Subject: | note 27351 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40283@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,
--
http://www.php.net/manual/en/function.date.php
http://master.php.net/manage/user-notes.php?action=edit+27351
http://master.php.net/manage/user-notes.php?action=delete+27351
http://master.php.net/manage/user-notes.php?action=reject+27351