Monday, November 29, 2010

Re: Django timestamp to Javascript timestamp

Unix (and python) timestamps are also from the beginning of Jan 1, 1970, but are
in seconds, so you might think that multiplying by 1000 would be enough. But
unix timestamps (and, presumably, their emulation on Windows) are in GMT, while
JavaScript, if memory serves, uses the browser's local machine's timezone. JS
data/time manipulations have enough stuff to fix this, but you have to
work a bit,
including considering whether you are in daylight savings time, etc..

Bill

On Mon, Nov 29, 2010 at 1:16 PM, Matt Thompson <thompsonson@gmail.com> wrote:
> Hello guys and girls,
>
> I'm looking to use Flot to graph some data I have in my Django app.
> I'd like to graph a time based query and need to get the time is
> Javascript format (milliseconds since 01/01/1970).
>
> I can get it into seconds\unix format, this is seconds since
> 01/01/1970, but not milliseconds.
>
> Can anyone help?
>
> Thanks,
> Matt
>
>
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment