timezones question

3 views
Skip to first unread message

Alex Arshavski

unread,
Jan 1, 2012, 1:18:47 PM1/1/12
to pywe...@googlegroups.com
Hi,

I have a question:

I have a django app with customers. Each customer has it's timezone.
Now I want to show some statistic graphs with time and date according to customer's timezone.
So I tried to add to my middleware:

os.environ['TZ'] = str(customer.timezone)

time.tzset()

and also:

timezones2.activate(customer.timezone)

with django-timezones2 app. Both of them give me 11:00 in Tokyo when it's 01:00.

Did somebody has the same problem? How can I get the correct time and date?

Thanks, Alex A.


שי

unread,
Jan 2, 2012, 4:51:13 AM1/2/12
to PyWeb-IL
take a look at:
https://code.djangoproject.com/ticket/2626
and
https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TIME_ZONE
https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-USE_TZ

hope this helps
shay

On Jan 1, 8:18 pm, Alex Arshavski <alexar...@gmail.com> wrote:
> Hi,
>
> I have a question:
>
> I have a django app with customers. Each customer has it's timezone.
> Now I want to show some statistic graphs with time and date according to
> customer's timezone.
> So I tried to add to my middleware:
>
> *os.environ['TZ'] = str(customer.timezone)*
>
> *time.tzset()*
>
> and also:
>
> *timezones2.activate(customer.timezone)*
Reply all
Reply to author
Forward
0 new messages