# Geonames DST problem

**URL:** <https://www.ruby-forum.com/t/geonames-dst-problem/189606>\
**Category:** Ruby\
**Created:** [June 3, 2010, 9:10pm UTC](https://www.ruby-forum.com/t/geonames-dst-problem/189606 "2010-06-03T21:10:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtnbiker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@mtnbiker](https://www.ruby-forum.com/u/mtnbiker)\
**Post date:** [June 3, 2010, 9:10pm UTC](https://www.ruby-forum.com/t/geonames-dst-problem/189606/1 "2010-06-03T21:10:09Z")

</div>

The script:

#!/usr/bin/env ruby  
require ‘rubygems’  
require ‘geonames’

lat=-54.936772  
lon=-67.604408

timezone = Geonames::WebService.timezone lat, lon  
dst\_offset = timezone.dst\_offset.to\_i # Is this for the day it’s done?  
FIX to\_i is not ROBUST  
gmt\_offset = timezone.gmt\_offset.to\_i # not affected by DST  
timezone\_id = timezone.timezone\_id # Wordy version of timezone  
puts “timezone\_id: #{timezone\_id} \ngmt\_offset: #{gmt\_offset}  
\ndst\_offset: #{dst\_offset}”

places\_nearby = Geonames::WebService.find\_nearby\_place\_name lat, lon  
location = “#{places\_nearby.first.name},  
#{places\_nearby.first.country\_name}”

puts “location: #{location}”

# Result

# timezone\_id: America/Santiago

# gmt\_offset: -3

# dst\_offset: -4

# location: Puerto Williams, Chile

Am I mixed up or is the answer backwards?

Here in California GMT-8 and DST is -7. Santiago should be on standard  
time now, not that that’s relevant to what I think should be being  
delivered.
