Am 16.12.2011 10:45, schrieb Ulrich Eckhardt:
I'm trying to create a struct_time that is e.g. one year ahead or a
month back in order to test some parsing/formatting code with different
dates.

There is something I stumbled across that helps and that is the datetime module, which seems more reasonably pythonic, and which allows operations on dates like adding a

Concerning the idea to use seconds, I'd rather not, because already the number of seconds per minute ranges from 60 to 62, and it doesn't get better with things like months (28...31 days), years (365...366 days) and all other types built upon them.

Considering the question if the current state is buggy, I'm definitely +1 on it. I do understand that this API is not going to change, but explicitly documenting in "help(time)" that the order is fixed and possibly making the order programmatically available are not changes but useful additions, IMHO. Also, conversion from/to a dict and perhaps a link to the datetime module would have saved me some futile attempts.

Thanks to all responders, I wish you a happy weekend!

Uli

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to