note 60619 added to function.date
| From: | mrc at interdoc dot ch | Date: | Thu, 12 Jan 2006 14:02:38 +0000 |
| Subject: | note 60619 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101626@lists.php.net to get a copy of this message | ||
Note that PHP and mysql don't use the same format for the week numbers. PHP uses 2006-1,
2006-2, 2006-3, ... as MYSQL (ie. DATE_FORMAT(t_stamp,'%x-%v')) uses 2006-01, 2006-02,
2006-03, ...
To use a PHP date (generated with date('Y-W',$t_stamp)) in MYSQL you can transform it
with:
$mydate=preg_replace('
-([1-9])$','-0$1',$mydate);
Marc Reymond
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60619
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60619&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60619&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60619&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60619&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60619&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60619&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60619&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60619&report=yes
Search -- http://master.php.net/manage/user-notes.php