#49227 [NEW]: Paradox Timestamp format is not accurately documented

From: Date: Wed, 12 Aug 2009 01:47:03 +0000
Subject: #49227 [NEW]: Paradox Timestamp format is not accurately documented
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2630@lists.php.net to get a copy of this message
From: jordanhoneycutt at gmail dot com Operating system: Ubuntu 9.04 PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: Paradox Timestamp format is not accurately documented 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 bug report at http://bugs.php.net/?id=49227&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49227&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49227&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49227&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49227&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49227&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49227&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49227&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49227&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49227&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49227&r=support Expected behavior: http://bugs.php.net/fix.php?id=49227&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49227&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49227&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49227&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49227&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49227&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49227&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49227&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49227&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49227&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49227&r=mysqlcfg

« previous php.doc.bugs (#2630) next »