It would be a great feature to add to GAE in the future (have a
generic user settings page).
For now, here is my summary of the options for GAE/DB apps dealing
with UTC & timezones:
1. Leave the date/time in a specific timezone (such as the location of
your server or the site owner) for anonymous users.
Eg: Engadget shows time in East Coast Time (EST) USA; Sydney Morning
Herald (
www.smh.com.au) always shows local Sydney time.
2. Same as 1, but provide a settings screen for users to set their
current timezone (either a user account, or a anonymous settings
stored in a cookie)
Eg: Most forums such as phpBB use this method.
3. Automatically detect the timezone of the browser using javascript
date object (this requires browser to have javascript enabled). Either
a login screen is provided that can post the timezone to the server ,
or the page has a date print function that runs dynamically to adapt
the pages during rendering.The timezone could be stored in a cookie
updated whenever the time on the computer changes.
Eg: GMail sends the timezone when a user uses the login screen
(
gmail.com, view source).
4. Avoid the problem completely by using relative time descriptions,
such as 1 minute ago, 10 hours ago, 1 year 125 days ago, In 10 hours,
In 2 weeks 1 day.
Eg: Digg does this for news entries; Facebook does this for status
updates.
5. Infer the timezone from the IP address.
Eg:
ip2location.com provides the lookup. Can be costly and adds to
the request time while the server has to do the lookup.
BTW: Credit to mrshoe for emailing me about using javascript in point
(3) above, use: "new Date().getTimezoneOffset()" to get the tz.
Peter
On Apr 9, 2:17 pm, Brett <
brettalici...@gmail.com> wrote:
> On Apr 9, 12:54 pm, "Ryan Mulligan" <
r...@ryantm.com> wrote:
>
> > I don't entirely agree. Google Accounts has information about user's
> > timezones, because you can set it ony our account settings page. The root
> > question is, do they expose thistimezoneto us?
>
> Google Accounts do not always havetimezoneinformation. Many products
> let you set this to something specific (see Google Calendar).
>
>
>
> > On Wed, Apr 9, 2008 at 2:24 PM, Dustin <
dsalli...@gmail.com> wrote:
>
> > > This doesn't have anything to do with GAE. You're asking your
> > > question in the wrong part of google.
>
> > > On Apr 9, 10:48 am, peterept <
peter...@gmail.com> wrote:
> > > > I'm storing date/time in UTC in the db. When displaying I want to show
> > > > them converted to the user's currenttimezone(of thebrowserthey are
> > > > using).
>
> > > > TIA,
>
> > > > Peter- Hide quoted text -
>
> - Show quoted text -