How do I get the datetime object of today's 5pm in Python? -
I want to create a countdown app that will count up to 5 o'clock today. How do I do this with data-object? In short, I just want to get Unix time at 5 o'clock.
I saw the doctor, but I feel a bit lost. Thanks in advance for any help!
You can combine one with:
Five minutes = Datetime.datetime.combine (datetime.date.today (), datetime.time (17, 0))
Creates a new date time
example and Time from the example given
Demo:
& gt; & Gt; & Gt; Import Date Time & gt; & Gt; & Gt; Datetime.datetime.combine (... datetime.date.today (), ... datetime.time (17, 0)) datetime.datetime (2014, 7, 27, 17, 0)
Comments
Post a Comment