On 10/08/2015 11:46 PM, Charlie Clark wrote:
> Am .10.2015, 02:32 Uhr, schrieb Marcos Vinícius Petri <
mvp...@gmail.com>:
>
>> from openpyxl.utils import datetime
>> print datetime.W3CDTF_to_datetime("1990-04-03")
>
> That is a date and not a datetime and so cannot be converted to a datetime.
Seems to be a bug in W3CDTF_to_datetime, as Python thinks it is a datetime:
In [4]: datetime(1990, 4, 3)
Out[4]: datetime.datetime(1990, 4, 3, 0, 0)
https://docs.python.org/2/library/datetime.html#datetime-objects
class datetime.datetime(year, month, day[, hour[, minute[, second[,
microsecond[, tzinfo]]]]])
The year, month and day arguments are required.
>
> Normally, you will never need to do the conversion yourself. Just create
> a Python date, datetime or time object and openpyxl will correctly
> convert it into Excel's serial (epoch 1900) format.
>
> Charlie
--
Adrian Klaver
adrian...@aklaver.com