Creating time stamps
Michael F. Stemper
michael.stemper at gmail.com
Mon Jul 22 18:58:29 EDT 2019
On 22/07/2019 16.00, Stefan Ram wrote:
> "Michael F. Stemper" <michael.stemper at 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.
More information about the Python-list
mailing list