On Sun, Sep 7, 2008 at 9:33 PM, Wayne Watson
<[EMAIL PROTECTED]> wrote:
> Here's as far as I can go with this. The last line of output asks the
> question I need an answer for.
> (Once again my direct post to tutor@python.org has failed to appear here
> (sent 5:42 PDT), as before.)

It arrived late for some reason.

You can do what you want much more simply using datetime.strptime()
and strftime():
In [2]: from datetime import datetime, timedelta
In [3]: format = '%Y%m%d_%H%M%S'
In [8]: d=datetime.strptime('20080321_113405', format)
In [10]: d
Out[10]: datetime.datetime(2008, 3, 21, 11, 34, 5)
In [13]: d += timedelta(seconds=200)
In [14]: d
Out[14]: datetime.datetime(2008, 3, 21, 11, 37, 25)
In [15]: d.strftime(format)
Out[15]: '20080321_113725'

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to