note 52234 added to ref.com
| From: | angelo[at]mandato" com | Date: | Mon, 25 Apr 2005 16:11:42 +0000 |
| Subject: | note 52234 added to ref.com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88529@lists.php.net to get a copy of this message | ||
ADO + PHP5 + SQL DATE FIELDS
Using a COM("ADODB.Connection") object in PHP4 and PHP5 to return date fields in databases
will have different results.
In PHP4, the date is returned as a string as represented in the database. In my case,
'2005-04-11 11:35:44'.
In PHP5, the date is returned as a VARIANT type, when printed or implicitly casted would result as
'4/11/2005 11:35:44 AM'.
For this example, the solution is to use the variant conversion function variant_date_to_timestamp()
to convert the value to a Unix timestamp.
Please refer to this as an example. Other date types may be converted using one of the other
variant_<convert> functions.
----
Manual Page -- http://www.php.net/manual/en/ref.com.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52234
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52234&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52234&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52234&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52234&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52234&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52234&report=yes
Search -- http://master.php.net/manage/user-notes.php