Spreadsheet-WriteExcel - Re: Time Formula not working correctly when generated by spreadsheet::writeExcel

Posted on Fri Apr 15 01:49:28 2005 by jmcnamara in response to 342 (See the whole thread of 3)
Re: Time Formula not working correctly when generated by spreadsheet::writeExcel

In your code you are writing strings, not times:

$worksheet1->write(1, 0, "9:59 AM", $timeFormat ); $worksheet1->write(2, 0, "10:00 AM", $timeFormat );

Instead you need to do something like this

$worksheet1->write_date_time(1, 0, "T09:59", $timeFormat); $worksheet1->write_date_time(2, 0, "T10:00", $timeFormat);

See the Dates in Excel and write_date_time() sections of the Spreadsheet::WriteExcel documentation for more details.

John.
--
Direct Responses: 348 | Write a response