--- a/src/pyams_utils/date.py Thu Oct 18 14:12:11 2018 +0200
+++ b/src/pyams_utils/date.py Fri Oct 19 17:18:42 2018 +0200
@@ -258,11 +258,15 @@
A PyAMS TALES extension to get timestamp based on last context modification date.
"""
- def render(self, context=None):
+ def render(self, context=None, formatting=None):
if context is None:
context = self.request.context
+ if formatting == 'iso':
+ format_func = datetime.isoformat
+ else:
+ format_func = datetime.timestamp
dc = IZopeDublinCore(context, None)
if dc is None:
- return datetime.utcnow().timestamp()
+ return format_func(datetime.utcnow())
else:
- return dc.modified.timestamp()
+ return format_func(dc.modified)