Ticket #15267: django_now_template_tag.diff
File django_now_template_tag.diff, 775 bytes (added by , 14 years ago) |
---|
-
django/template/defaulttags.py
381 381 382 382 def render(self, context): 383 383 from datetime import datetime 384 from django.utils import formats 384 385 from django.utils.dateformat import DateFormat 385 df = DateFormat(datetime.now()) 386 return df.format(self.format_string) 386 now=datetime.now() 387 try: 388 return formats.date_format(now, self.format_string) 389 except AttributeError: 390 df = DateFormat(now) 391 return df.format(self.format_string) 387 392 388 393 class SpacelessNode(Node): 389 394 def __init__(self, nodelist):