Forums

How to show the time of correct timezone in web2py?

I have a few apps in web2py and every one of them seem to have the same problem, where the times they show seem to be GMT+0, whereas I'm currently in GMT+3 zone. I remember trying web2py offline for the first time and it showed the time from correct timezone (actually it took it from my laptop's clock, because my laptop was set on GMT+3, while I was travelling in GMT+2 zone), so the problem seems to be on pythonanywhere side.

Is there any way to show the time correctly?

Remember, there are two different timezones here -- the one that's correct for the server, and the one that's correct for a particular browser accessing the server. Because browsers accessing sites on PythonAnywhere can be in any timezone, we set the server's timezone to UTC.

I believe that web2py has built-in functionality to detect the timezone preferred by any given request (see, for example, this web2py slice) but you'll get a more definitive answer if you ask on the web2py Google group.