<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Calculating Timezone using information obtained from the API"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "Calculating Timezone using information obtained from the API"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Calculating Timezone using information obtained from the API</title>
				<description><![CDATA[ Hi everyone,

@Dev who is providing this service, thank you very much! It is a life saver. 

I am currently confused slightly about the timezone. Let me first describe my situation. 

I am the developer of the clock app for the Ubuntu Touch platform for mobiles, tablets and desktops. One of the planned features is World Clocks. I have already implemented quite a bit of it, but am unable to proceed further without making a decision. My original plan was to allow the user to search for a city, which would then in turn retrieve the city's timezone info. However I only intend to to do this once and then perhaps update every week or so to see if the timezone has changed (due to DST or whatever). With this plan, I ruled out retrieving the local time using the api since it is only useful at that point. Instead I retrieved the rawOffset since I can use that to calculate the time at a particular location by adding the offset to UTC. I also did read that GmtOffSet and DstOffset is deprecated (in the docs).

However, I noticed that that rawOffset works for countries which do not have DST. While in cities like London, my time calculation was off by an hour.

Do you have any ideas on how to solve this problem? 

Should I instead retrieve the local time at the destination and compare it with my system (app) time and then get the diff. I can then probably use the diff to calculate the time at the destination in the near future?

I just feel that by checking the local time using the API every day is a bit too much for a mobile app.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4286.page#12497</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4286.page#12497</link>
				<pubDate><![CDATA[Wed, 12 Jun 2013 07:00:15]]> GMT</pubDate>
				<author><![CDATA[ krnekhelesh]]></author>
			</item>
			<item>
				<title>Re:Calculating Timezone using information obtained from the API</title>
				<description><![CDATA[ Hi krnekhelesh

I read the output this way >>
rawOffset = gmtOffset = StandardTime TimeZone
dstOffset = DST TimeZone
...these are invariable values, just to show the possible range, they say nothing about the true time there...

This works for me >>
My system gives me my true System-Time as GMT/UTC
GeoNames returns the true local time in the local TimeZone, DST corrected

diffToGMT = TrueLocalTime - TrueSystemGMTtime
TrueLocalTimeZone = Round(4 * diffToGMT, 0) / 4

...the "4" are to return the TimeZone in 15 min steps (...yes, even a 5.75 and a 12.75 TimeZone exist)

Now you have the TrueLocalTimeZone... until the next recalculation...

Regards
Urs]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4286.page#12501</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4286.page#12501</link>
				<pubDate><![CDATA[Thu, 13 Jun 2013 07:11:02]]> GMT</pubDate>
				<author><![CDATA[ saphir]]></author>
			</item>
			<item>
				<title>Re:Calculating Timezone using information obtained from the API</title>
				<description><![CDATA[ Hi krnekhelesh 

The timezone identifier should normally be sufficient. Most programming environments have the DST rules included and all you need is this identifier. The rules for DST are very different from timezone to timezone and may also change from year to year. 

Java for instance has this class:
http://docs.oracle.com/javase/6/docs/api/java/util/TimeZone.html

Marc]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/4286.page#12509</guid>
				<link>http://forum.geonames.org/gforum/posts/list/4286.page#12509</link>
				<pubDate><![CDATA[Mon, 17 Jun 2013 09:12:55]]> GMT</pubDate>
				<author><![CDATA[ marc]]></author>
			</item>
	</channel>
</rss>