BTW, That is with a timezone of "America/New_York"
On Feb 21, 1:05 pm, Sean Brant wrote:
> Would something like this work?
>
> def U(self):
> "Seconds since the Unix epoch (January 1 1970 00:00:00 GMT)"
> import calendar
> timestamp =
Would something like this work?
def U(self):
"Seconds since the Unix epoch (January 1 1970 00:00:00 GMT)"
import calendar
timestamp = calendar.timegm(self.data.timetuple())
return timestamp + time.timezone
Test:
r"""
>>> print dateformat.format(my_birthday, 'U')
40437
"""
On Fri, 2009-02-20 at 19:45 -0500, Karen Tracey wrote:
[...]
> Near as I can tell, also, the "U" date-formatting implementation
> doesn't work. It is:
>
> def U(self):
> "Seconds since the Unix epoch (January 1 1970 00:00:00 GMT)"
> off = self.timezone.utcoffset(self.data)
On Fri, Feb 20, 2009 at 6:21 PM, Jeff FW wrote:
>
> I just tried running the code that the "U" date-formatting parameter
> uses, and for me, it was off by about 11.5 days. According to the
> documentation, the "U" parameter is not implemented:
>
I just tried running the code that the "U" date-formatting parameter
uses, and for me, it was off by about 11.5 days. According to the
documentation, the "U" parameter is not implemented:
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#now
According to this ticket, someone might
> I asked a similar question a while ago... turns out the server i'm
> using from godaddy was set for Arizona and was an additional 20 some
> minutes off...
I checked my server and the timezone is set to US/CENTRAL and my
settings file is set to America/Chicago. So that should be the same.
Plus
server date incorrect?
I asked a similar question a while ago... turns out the server i'm
using from godaddy was set for Arizona and was an additional 20 some
minutes off...
On Feb 20, 11:49 am, Sean Brant wrote:
> I am trying to render a timestamp in my template with
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
8 matches
Mail list logo