made program output better

This commit is contained in:
Rinaldus 2018-07-12 10:48:14 +03:00
parent 41ecdae7b5
commit 0e8f6e2125
Signed by: Rinaldus
GPG Key ID: C34E249005178E87
1 changed files with 3 additions and 1 deletions

View File

@ -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[
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))