Contact: aviboots(AT)netvision.net.il
39,938 questions
51,875 answers
573 users
import datetime today = datetime.datetime.now() print(str(today)) ''' run: 2017-09-28 12:32:23.553181 '''
import datetime today = datetime.datetime.now() print(repr(today)) ''' run: datetime.datetime(2017, 9, 28, 12, 38, 0, 57398) '''
from datetime import datetime d = datetime.now() s = d.strftime("%B the %d of %Y is %A at %I:%M %p") print(s) print(type(s).__name__) ''' run: June the 21 of 2021 is Monday at 03:45 PM str '''