from Components.Converter.Converter import Converter
-from time import localtime
+from time import localtime, strftime
class ClockToText(Converter, object):
DEFAULT = 0
WITH_SECONDS = 1
IN_MINUTES = 2
+ DATE = 3
# add: date, date as string, weekday, ...
# (whatever you need!)
self.type = self.WITH_SECONDS
elif type == "InMinutes":
self.type = self.IN_MINUTES
+ elif type == "Date":
+ self.type = self.DATE
else:
self.type = self.DEFAULT
return "%2d:%02d:%02d" % (t.tm_hour, t.tm_min, t.tm_sec)
elif self.type == self.DEFAULT:
return "%02d:%02d" % (t.tm_hour, t.tm_min)
+ elif self.type == self.DATE:
+ return strftime("%A %B %d, %Y", t)
else:
return "???"