diff --git a/cccli/tagdisplay.py b/cccli/tagdisplay.py index 621385c16ab83c58d6ce457bd04561e00d5ca6ae..232825202935ed683bf9af9f332688374f90b3cf 100644 --- a/cccli/tagdisplay.py +++ b/cccli/tagdisplay.py @@ -13,6 +13,7 @@ import math import ConfigParser import time import fnmatch +import datetime class TagDisplay(object): '''Handle tagdisplay stuff''' @@ -146,3 +147,17 @@ class TagDisplay(object): return u"%dd%dh%dm%ds"%(v/86400, v/3600%24, v/60%60, v%60) return value + def type_date(self, value): + '''date type''' + d = datetime.date.fromtimestamp(float(value)) + return d.strftime("%d/%m/%Y") + + def type_time(self, value): + '''date type''' + d = datetime.date.fromtimestamp(float(value)) + return d.strftime("%H:%M:%S") + + def type_datetime(self, value): + '''date type''' + d = datetime.date.fromtimestamp(float(value)) + return d.strftime("%d/%m/%Y %H:%M:%S")