0

所以我需要用 FPDF 用荷兰语显示日期。我试过“$this->setlocale(LC_TIME, 'NL_nl');” 中间,之前和之后。但所有这些都只是给我一个错误:“致命错误:在 C:\wamp\www\application\controllers\pdfinvoice.php 第 52 行调用未定义的方法 PdfInvoice::setlocale()”

我现在能做什么?

编码:

    $dateinvoice = substr( $invoice[ 'dateinvoice' ], 6 ).substr( $invoice[ 'dateinvoice' ], 3, 2 ).substr( $invoice[ 'dateinvoice' ], 0, 2 );
    $dateinvoice = date_create( $dateinvoice );
    $dateinvoice = false === $dateinvoice ? '' : $dateinvoice->format( 'd F Y' );
    $this->Cell( 10 ); $this->Cell( 40, 7, 'Datum' ); $this->Cell( 0, 7, $dateinvoice, 0, 1 );
4

1 回答 1

0
/* Set locale to Dutch */
setlocale(LC_ALL, 'nl_NL');

/* Output: vrijdag 22 december 1978 */
echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));
于 2013-10-22T18:00:43.423 回答