Date fields are retrieved as the number of days since 0 A.D. (I think), but not as anything resembling a date. If you are exporting this data, you must used this function to convert. Read the schema first to determine which fields are date fields...
<?php
$schema = $pxdoc->get_schema();
$dateFields = array();
foreach ($schema as $key => $attrs) {
if ($attrs["type"] == PX_FIELD_DATE) $dateFields[] = $key;
}
?>
An export to a CSV format, for example, could them be written...
<?php
for ($rec = 0; $rec < $totRecs; ++$rec) {
$arr = $pxdoc->get_record($rec);
foreach ($dateFields as $key) {
$arr[$key] = $pxdoc->date2string($arr[$key], "m/d/Y");
}
fputcsv(STDOUT, $arr); }
?>