Get the timezone of the user

1,021 views
Skip to first unread message

Michael Nachbaur

unread,
Feb 4, 2009, 3:00:13 PM2/4/09
to phonegap
Is there a way to figure out what timezone the iPhone user is
currently in? My client/server application communicates with a server
that's based out of UTC, and I'd prefer to have its messages and
expiry times be relative to the user's timezone, as opposed to some
unknown number of hours off.

Jeremy Edgell

unread,
Feb 4, 2009, 3:14:05 PM2/4/09
to phon...@googlegroups.com
Not that I know of; one of the developers might know better, but the way I'd approach it with phonegap is to pull the user's lat/long and look up the timezone on a service like http://www.earthtools.org/webservices.htm.

The down side is the 1 request per second & caching rule, however with a little thinking through, you should have no problems with this, especially if you use a js library like jquery to do the lookups on the phone side, rather than at the server. Might be a little slower, but could be worth exploring.

kazoomer

unread,
Feb 4, 2009, 3:22:15 PM2/4/09
to phonegap
Whats wrong with using the JavaScript Date Object? Am I missing
something?

https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global...
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global...

Rob Ellis
Phonegap.com
Nitobi.com

On Feb 4, 12:14 pm, Jeremy Edgell <edge...@gmail.com> wrote:
> Not that I know of; one of the developers might know better, but the way I'd
> approach it with phonegap is to pull the user's lat/long and look up the
> timezone on a service likehttp://www.earthtools.org/webservices.htm.<http://www.earthtools.org/webservices.htm>
> The down side is the 1 request per second & caching rule, however with a
> little thinking through, you should have no problems with this, especially
> if you use a js library like jquery to do the lookups on the phone side,
> rather than at the server. Might be a little slower, but could be worth
> exploring.
>

Jeremy Edgell

unread,
Feb 4, 2009, 3:41:52 PM2/4/09
to phon...@googlegroups.com
--sometimes I like to overthink things--

sorry!

kazoomer

unread,
Feb 4, 2009, 4:54:18 PM2/4/09
to phonegap
No worries, good luck with your app.

Rob Ellis
PhoneGap.com
Nitobi.com


On Feb 4, 12:41 pm, Jeremy Edgell <edge...@gmail.com> wrote:
> --sometimes I like to overthink things--
> sorry!
>
Reply all
Reply to author
Forward
0 new messages