Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4047232
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:39:53+00:00 2026-05-20T13:39:53+00:00

My rails 3 app needs to interact with an external webservice. This webservice provides

  • 0

My rails 3 app needs to interact with an external webservice. This webservice provides information about raining events across the entire US (ultimately the country doesn’t matter). The pertinent information is start/end time formatted as ISO8601 including timezone. The server will run on the east coast of the US (so EST, soon to be EDT). All database entries will be stored as UTC.

I need to be able to store the timezone(TZ) in which the event takes place so I present the user with options to view the events in their own TZ or in the originating TZ. Once they reach the location they won’t care if the event starts based on their HOME TZ but TZ in which the event will happen.

input data:

start = "2011-04-08T10:00:00-06:00"
  end = "2011-04-08T16:00:00-06:00"

#fyi
Time.zone => GMT-05:00 Eastern Time US  Canada

# Server time zone, original time zone lost !!!!
Time.parse(start) => 2011-04-08 12:00:00 -0400

# UTC, time zone lost
Time.zone.parse("2011-04-08T10:00:00-06:00") => Fri, 08 Apr 2011 16:00:00 UTC 00:00

I don’t see any way (minus manual string manipulation) to get the original, -06:00 TZ (MST). I was really hoping there would be a RoR way get this info … seems like there should be a way!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T13:39:54+00:00Added an answer on May 20, 2026 at 1:39 pm

    If you use Time you will lose information, but if you use DateTime you will be fine:

    DateTime.parse("2011-04-08T10:00:00-06:00")
    # => Fri, 08 Apr 2011 10:00:00 -0600
    

    The DateTime class is much more robust than Time and can encode a lot more information, though is slower and more memory hungry. Fortunately, performance will not be an issue unless you are spending most of your time manipulating values like this in large batch operations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on my first Rails app. It needs to store some information about
I have a MySQL/Rails app that needs search. Here's some info about the data:
I have a rails app that needs a lot of initial data. This data
I have a Rails app that needs to expose values from a database as
We're working on a Ruby on Rails app that needs to take advantage of
I have a ruby on rails app running a server and sometimes it needs
I have a silverlight application that needs to talk to a rails app to
I am writing my first rails app. It needs to aggregate some data from
So I need to access this service from my rails app. I'm using soap4r
My rails 3 app needs to use a SELECT DISTINCT which (as far as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.