#49227 [Opn->Csd]: Paradox Timestamp format is not accurately documented
| From: | vrana@php.net | Date: | Mon, 16 Nov 2009 11:37:22 +0000 |
| Subject: | #49227 [Opn->Csd]: Paradox Timestamp format is not accurately documented | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3175@lists.php.net to get a copy of this message | ||
ID: 49227
Updated by: vrana@php.net
Reported By: jordanhoneycutt at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Ubuntu 9.04
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2009-08-12 01:47:02] jordanhoneycutt at gmail dot com
Description:
------------
The PECL package that adds support for Paradox database tables to PHP
does not correctly address the Paradox PX_FIELD_TIMESTAMP format. The
included method px_timestamp2str(), does not return an accurate
representation of the timestamp. Additionally, the description of
PX_FIELD_TIMESTAMP is incorrect. I understand the developer of this
extension doesn't intend for it to ever progress past an experimental
project. Would you please update the documentation with these
corrections?
Paradox timestamps are the number of milliseconds since 0001-01-01 (or
practically, 0001-01-02 as they seem to start counting at the end of
January 1st, 1 AD. Note that there was no 0 AD) The px_timestamp2str()
method does not seem to function properly when converting the timestamp,
providing a date that is off by one day, and a time that always defaults
to an incorrect time. Instead you can use the following calculation to
convert PX_FIELD_TIMESTAMP to a unix timestamp:
$unixtime = ($record["timestamp"] / 1000) - (719163 * 86400)
Reproduce code:
---------------
px_timestamp2str($pxdoc,63385727274000,"Y-m-d H:i")
Expected result:
----------------
should return "2009-08-11 9:27" or 1250044074 unix timestamp.
Actual result:
--------------
2009-08-12 -3:-14
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49227&edit=1