On 22/07/2019 16.00, Stefan Ram wrote: > "Michael F. Stemper" <michael.stem...@gmail.com> writes: >> The first seems a little clunky with its accessing of multiple >> attributes, but the second has an additional import. Is there >> any reason to prefer one over the other? > > |>>> import datetime > |>>> datetime.datetime.now().replace(microsecond=0).isoformat() > |'2019-07-22T21:59:58'
Yeah, if I'd wanted that format, isoformat() would have been simpler. Since I did not want seconds, or the letter "T", I had to go for a home-brewed solution. -- Michael F. Stemper No animals were harmed in the composition of this message. -- https://mail.python.org/mailman/listinfo/python-list