[pyxl] xlrt date writing

84 views
Skip to first unread message

Glen Luckjiff

unread,
May 12, 2010, 10:59:09 AM5/12/10
to python-excel
From the code snippet in cell_types.py:

ws.row(3).write(0,date(2009,3,18))
ws.row(3).write(1,datetime(2009,3,18,17,0,1))
ws.row(3).write(2,time(17,1))
ws.row(4).set_cell_date(0,date(2009,3,18))
ws.row(4).set_cell_date(1,datetime(2009,3,18,17,0,1))
ws.row(4).set_cell_date(2,time(17,1))

However I see
39890 39890.70834 0.709027778
39890 39890.70834 0.709027778
in the excel.

Using Excel 2003 - that's the problem right?

Thanks,
Glen

--
You received this message because you are subscribed to the Google Groups "python-excel" group.
To post to this group, send an email to python...@googlegroups.com.
To unsubscribe from this group, send email to python-excel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/python-excel?hl=en-GB.

Glen Luckjiff

unread,
May 12, 2010, 11:16:31 AM5/12/10
to python-excel
Pardon, I'll answer my own question.
easyxf

as in the demo easyxf_format.py

John Machin

unread,
May 12, 2010, 5:57:14 PM5/12/10
to python...@googlegroups.com
On 13/05/2010 1:16 AM, Glen Luckjiff wrote:
> Pardon, I'll answer my own question.
> easyxf
>
> as in the demo easyxf_format.py
>
> On May 12, 10:59 am, Glen Luckjiff <luckj...@gmail.com> wrote:
>> From the code snippet in cell_types.py:
>>
>> ws.row(3).write(0,date(2009,3,18))
>> ws.row(3).write(1,datetime(2009,3,18,17,0,1))
>> ws.row(3).write(2,time(17,1))
>> ws.row(4).set_cell_date(0,date(2009,3,18))
>> ws.row(4).set_cell_date(1,datetime(2009,3,18,17,0,1))
>> ws.row(4).set_cell_date(2,time(17,1))
>>
>> However I see
>> 39890 39890.70834 0.709027778
>> 39890 39890.70834 0.709027778
>> in the excel.
>>
>> Using Excel 2003 - that's the problem right?

Looks like cell_types.py (page 26 of the tutorial) needs updating to
heed the advice given 2 pages earlier: """Note: As mentioned earlier, a
date is not really a separate type in Excel; if you don't apply a
date format, it will be treated as a number."""

Thanks for pointing this out.

Cheers,
John
Reply all
Reply to author
Forward
0 new messages