Create datetime instance using a tuple.

Negroup negroup at gmail.com
Wed Jul 6 05:01:55 EDT 2005


Hi, all.
I would like to know if it is possible to create a datetime instance
using a tuple instead of single values.

I mean:
>>> from datetime import datetime
>>> t = (1, 2, 3)
>>> dt = datetime(t)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: function takes at least 3 arguments (1 given)

(class datetime(year, month, day[, hour[, minute[, second[,
microsecond[, tzinfo]]]]])

Thanks.



More information about the Python-list mailing list