note 102491 added to function.strtotime
| From: | a dot fruchi at bit-runners dot com | Date: | Thu, 17 Feb 2011 13:45:31 +0000 |
| Subject: | note 102491 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-177067@lists.php.net to get a copy of this message | ||
If you want to confront a date stored into mysql as a date field (not a datetime) and a date
specified by a literal string, be sure to add "midnight" to the literal string, otherwise
they won't match:
<?php
//I.E.: today is 17/02/2011
echo strtotime('2011-01-01'); //1293836400
echo strtotime('first day of last month'); //1293888128 Note: it's different from the
previous one, since it computes also the seconds passed from midnight!!! So this one is always
greater than simple '2011-01-01'
echo strtotime('midnight first day of last monty');//1293836400 Note: it's the same
as '2011-01-01'
?>
----
Server IP: 69.147.83.197
Probable Submitter: 95.227.122.235
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- https://master.php.net/note/edit/102491
Del: integrated -- https://master.php.net/note/delete/102491/integrated
Del: useless -- https://master.php.net/note/delete/102491/useless
Del: bad code -- https://master.php.net/note/delete/102491/bad+code
Del: spam -- https://master.php.net/note/delete/102491/spam
Del: non-english -- https://master.php.net/note/delete/102491/non-english
Del: in docs -- https://master.php.net/note/delete/102491/in+docs
Del: other reasons-- https://master.php.net/note/delete/102491
Reject -- https://master.php.net/note/reject/102491
Search -- https://master.php.net/manage/user-notes.php