px_date2string

(PECL paradox >= 1.4.0)

px_date2string Converts a date into a string

说锟斤拷

px_date2string ( resource $pxdoc , int $value , string $format ) : string

Turns a date as it stored in the paradox file into human readable format. Paradox dates are the number of days since 1.1.0000. This function is just for convenience. It can be easily replaced by some math and the calendar functions as demonstrated in the example below.

锟斤拷锟斤拷

pxdoc

Resource identifier of the paradox database as returned by px_new().

value

Value as stored in paradox database field of type PX_FIELD_DATE.

format

String format similar to the format used by date(). The placeholders support by this function is a subset of those supported by date() (Y, y, m, n, d, j, L).

锟斤拷锟斤拷值

锟缴癸拷时锟斤拷锟斤拷 TRUE锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷

锟斤拷锟斤拷

Example #1 Turn a paradox date into a human readable form

<?php
$px 
px_new();

/* make up a date as it could be stored in */
/* a date field of a paradox db. */
/* 700000 days since 1.1.0000. */
$days 700000;

/* Use the calendar functions to print a */
/* human readable format of the date */
echo jdtogregorian($days+1721425)."\n";
/* px_date2string() outputs the same */
echo px_date2string($px$days"n/d/Y")."\n";

px_delete($px);
?>

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

7/15/1917
7/15/1917

锟轿硷拷

  • px_timestamp2string() - Converts the timestamp into a string
  • jdtogregorian() - 转锟斤拷一锟斤拷Julian Day锟斤拷锟斤拷为Gregorian锟斤拷锟斤拷锟斤拷锟斤拷