Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > geonames DST problem

Thread Tools

geonames DST problem

12 34
Posts: n/a
The script:

#!/usr/bin/env ruby
require 'rubygems'
require 'geonames'


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 = "#{},

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
Posted via

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
New article on grabbing city points from geonames, processing withPython, and rendering in MapPoint Eric Frost Python 0 02-03-2011 06:10 PM
Handling of DST in java nag Java 26 08-06-2010 06:30 AM
Parsing geonames 12 34 Ruby 15 06-05-2010 06:31 AM
Timezone/DST Big Jim Java 5 04-05-2006 06:18 PM
PIX log reporting dst outside: hoser Cisco 2 04-15-2005 05:22 PM