Browse Source

made program output better

master
Rinaldus 4 years ago
parent
commit
0e8f6e2125
Signed by: Rinaldus
GPG Key ID: C34E249005178E87
  1. 4
      countdown.py

4
countdown.py

@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
import datetime
import sys
import locale
locale.setlocale(locale.LC_TIME, "ru_RU.UTF-8")
now = datetime.datetime.now()
if (len(sys.argv) < 2):
@ -23,4 +25,4 @@ future = datetime.datetime(int(ar[2]),int(ar[1]),int(ar[0]),int(ar2[0]),int(ar2[ @@ -23,4 +25,4 @@ future = datetime.datetime(int(ar[2]),int(ar[1]),int(ar[0]),int(ar2[0]),int(ar2[
result = future - now
days = result.days
hours = datetime.datetime.strftime((datetime.datetime.utcfromtimestamp(result.seconds)), "%H:%M:%S")
print ("До указанной даты осталось " + str(days) + " дней " + str(hours))
print ("До " + datetime.datetime.strftime(future, "%d %B %Y года %H:%M") + " осталось " + str(days) + " дней " + str(hours))

Loading…
Cancel
Save