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