<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chris Chandler &#187; timezones</title>
	<atom:link href="http://chrischandler.name/tag/timezones/feed/" rel="self" type="application/rss+xml" />
	<link>http://chrischandler.name</link>
	<description>Squandering time as a raving egomaniac</description>
	<lastBuildDate>Thu, 03 Jun 2010 23:16:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Converting latitude and longitude to timezones</title>
		<link>http://chrischandler.name/ruby/converting-latitude-and-longitude-to-timezones/</link>
		<comments>http://chrischandler.name/ruby/converting-latitude-and-longitude-to-timezones/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 07:16:04 +0000</pubDate>
		<dc:creator>Chris Chandler</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[timezones]]></category>

		<guid isPermaLink="false">http://chrischandler.name/?p=39</guid>
		<description><![CDATA[A quick method for converting a latitude and longitude coordinate pair into a timezone.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve fought it out with <a href="http://en.wikipedia.org/wiki/Internationalization_and_localization">localization</a>(l10n) of timezones then you know it can be a pain in the ass.  Further, suppose your localizing arbitrary information where all you&#8217;ve really been given is an address.  The relevant information isn&#8217;t necessarily in your system and the user might be in the wrong timezone anyway, so no sense in using that.</p>
<p>Here&#8217;s a quick Ruby means to convert latitude and longitude into a timezone <a title="ActiveSupport" href="http://as.rubyonrails.org/">ActiveSupport</a> recognizes.  This snippet only relies on <a title="Hpricot" href="http://wiki.github.com/why/hpricot/hpricot-xml">Hpricot</a> and the freely available <a title="Geonames" href="http://www.geonames.org/">Geonames</a> API:</p>
<p><script src="http://gist.github.com/157902.js"></script></p>
<p>GMT offsets are a convenient way for moving time data in and out of UTC as well as for not having to deal with arbitrary string names.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrischandler.name/ruby/converting-latitude-and-longitude-to-timezones/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
