]> git.itanic.dy.fi Git - emerge-timer/commitdiff
Change how we printout the date
authorEsko Kokkonen <esko.kokkonen@gmail.com>
Wed, 15 Jun 2011 16:49:33 +0000 (19:49 +0300)
committerEsko Kokkonen <esko.kokkonen@gmail.com>
Wed, 15 Jun 2011 16:54:41 +0000 (19:54 +0300)
Use the string format method

emerge-timer.py

index fd8da840a05efc0145988614ed7779cd50f6047d..69d3eccdeefc95288d2dcbc6c154e1cf32ec442b 100755 (executable)
@@ -97,8 +97,7 @@ def date_printer(package, emerge_start, emerge_time):
     minute = str(date.minute)
     second = str(date.second)
 
-    date = (weekday + day + '/' + month + '/' + year + ' ' +
-            hour + ':' + minute + ':' + second)
+    date = "{:%d/%m/%Y %H:%M:%S}".format(date)
 
     print("Started emerging " + green_start + package + color_stop +
           " on " + date)