made program output better
This commit is contained in:
parent
41ecdae7b5
commit
0e8f6e2125
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue