How do I get datetime to stop showing seconds?
Frank Millman
frank at chagford.com
Fri Oct 16 04:34:01 EDT 2020
More information about the Python-list mailing list
Fri Oct 16 04:34:01 EDT 2020
- Previous message (by thread): How do I get datetime to stop showing seconds?
- Next message (by thread): How do I get datetime to stop showing seconds?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2020-10-16 9:42 AM, Steve wrote:
> d2 = datetime.datetime.now() #Time Right now
>
> Show this: 2020-10-16 02:53
> and not this: 2020-10-16 02:53:48.585865
>
>>>
>>> str(d2)
'2020-10-16 10:29:38.423371'
>>>
>>> d2.strftime('%Y-%m-%d %H:%M')
'2020-10-16 10:29'
>>>
Frank Millman
- Previous message (by thread): How do I get datetime to stop showing seconds?
- Next message (by thread): How do I get datetime to stop showing seconds?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list