Re: Question about Spreadsheet_Excel_Writer
| From: | Valeriy Krizhevich | Date: | Tue, 22 Nov 2005 12:23:50 +0000 |
| Subject: | Re: Question about Spreadsheet_Excel_Writer | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22057@lists.php.net to get a copy of this message | ||
wolverine4277 (sent by Nabble.com) wrote:
I have been use the Spreadsheet_Excel_Writer package but i can't write a date in dd/mm/yyyy format... For example: <?php require_once 'Spreadsheet/Excel/Writer.php'; $workbook = new Spreadsheet_Excel_Writer(); $date_format = & $this->workbook->addFormat( array( 'Align' => 'center', 'Border' => 1, 'BorderColor' => 'black', 'Color' => 'black', 'FgColor' => 'white', 'NumFormat' => 'DD/MM/YYYY', 'Size' => 10 ) ); $worksheet =& $workbook->addWorksheet(); $worksheet->write(0, 0, '2005/01/01, $date_format); ?> The date remains as 2005/01/01 and not 01/01/2005. The same happens with currency data, i have to output them in $00,000.00 or $-15.471,85 format, for exampe $-15,471.85 but the currency output is $-15471,85! Can help me with this??? Regards. -- Sent from the Pear - General forum at Nabble.com: http://www.nabble.com/Question-about-Spreadsheet_Excel_Writer-t594176.html#a1588467 Hello!I think it may be caused by the Excel while reading the file you generated. Probably, it uses Windows Regional Standard settings (see Control Panel), and converts you dates and moneys to the format that is set in the Panel. If you need your format for any price, write your dates and moneys not as formatted numbers, but as formatted text. I'm sure, your "." and "," problem with money resides here. Valeriy Krizhevich JSC Liepajas metalurgs programmer