php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30261 error reading ADODB date type?
Submitted: 2004-09-28 07:52 UTC Modified: 2004-09-28 09:40 UTC
From: is01yj at student dot zsu dot edu dot cn Assigned:
Status: Not a bug Package: COM related
PHP Version: 4.3.9 OS: Windows XP
Private report: No CVE-ID: None
 [2004-09-28 07:52 UTC] is01yj at student dot zsu dot edu dot cn
Description:
------------
This summer vacation I used COM(in PHP 5.0.1) to call ADODB in order to read some data from an Access Database. The database contained some fields in date type. Everything just ran well.
Later, I removed my pages to another server using PHP 4.3.9 and I found the data in date type can not be read correctly.
Should I just update PHP on this server to version above 5.0 in order to solve this problem? 

Reproduce code:
---------------
$MM_Conn_STRING="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db/xinghaiwww.mdb";
$connection=new COM("ADODB.Connection");
$connection->open($MM_Conn_STRING);
$rs=new COM("ADODB.RecordSet");
$strsql="select top 5 * from order by article_postdate desc";
$rs->open($strsql,$connection, 1, 1);

while (!$rs->eof) {
     $timestr=$rs->fields['article_postdate']->value;
//'article_postdate' is a field in date type
//.........
//ouput $timestr

Expected result:
----------------
in php 5.0.1, $timestr should be:
2004-8-26 17:44:58

Actual result:
--------------
in php 4.3.9, it became a string of numbers:
1093513498

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-28 09:41 UTC] wez@php.net
COM in PHP 4.x is no longer supported (except in exchange for $$$), and we recommend that you upgrade to PHP 5 where you have already noticed that it works so much better.

 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 16:05:48 2023 UTC