I am trying to render a timestamp in my template with date:"U" but the
timestamps are days off. I wrote up a simple test case that fails. Do
you think this is a bug or a user error? I am running rev: 9846.

from django.test import TestCase

class SimpleTest(TestCase):
    def test_template_timestamp(self):
        from datetime import datetime
        from django.template import Context, Template
        now = datetime.now()
        t = Template('{{ now|date:"U" }}')
        c = Context({'now': now})
        self.failUnlessEqual(int(now.strftime('%s')), int(t.render
(c)))

Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to