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 834393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:39:55+00:00 2026-05-15T04:39:55+00:00

I have a Rails app for bands. Bands can import their shows which all

  • 0

I have a Rails app for bands. Bands can import their shows which all occur in different time zones. It seems like a ton of work to store these events in UTC. I would have to figure out the time zone for any show created and then convert back to the show’s local time zone when displaying to the user. Is there a simple plugin to get a UTC offset based on geolocation? That would probably help, but does anyone see any major reasons why I should store in UTC here? I understand storing timestamps in UTC is probably a good idea…but band event times?

  • 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-15T04:39:56+00:00Added an answer on May 15, 2026 at 4:39 am

    I’m working on something similar – a site with a list of events. In my situation, it’s important to have the times standardized (in UTC) because we have announce and on-sale times to worry about (i.e., when the events appear on the site and when the on-sale links show up), not just displaying the event start time (which itself doesn’t care what time zone it’s in).

    Going from a UTC time in the database to the local time for the given venue (i.e., to display the local time in the event listing) is pretty simple using something along the lines of e.start.in_time_zone("#{e.venue.time_zone}"). What I couldn’t figure out was getting the local time at the point of data entry recognized as a local time needed to be converted to UTC, without having to deal with changing Time.zone.

    I found something that works. Check out this post: http://steveluscher.com/archives/changing-a-times-zone-in-rails-keeping-the-same-local-representation. I added a new file (time_zone_support.rb) to my config/initializers directory. Here are the contents:

    module ActiveSupport
      class TimeWithZone
        def zone=(new_zone = ::Time.zone)
          # Reinitialize with the new zone and the local time
          initialize(nil, ::Time.__send__(:get_zone, new_zone), time)
        end
      end
    end
    

    This allows the following in the console:

    >> e.starts = Time.zone.parse("2010-09-12 10:00 am")
    => Sun, 12 Sep 2010 10:00:00 UTC +00:00
    >> e.starts.zone = e.time_zone
    => "Pacific Time (US & Canada)"
    >> e.starts
    => Sun, 12 Sep 2010 10:00:00 PDT -07:00
    >> e.save
    => true
    

    Hope that helps you too!

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

Sidebar

Related Questions

I have rails app which has a list of users. I have different relations
I have rails app which are working perfectly in the local computer. But when
I have my rails app, which is filled with products, set up with a
I have a rails app. I also wrote a method in Java which constructs
We have a Rails app that has some pages that are available to all
I have a Rails app where users can upload images. After they upload an
i have a rails app which makes heavy use of activeresource and httparty to
I have a Rails app that uses STI to handle different types of Users,
I have huge Rails app on development right now, which run VERY slow on
I have a rails app which uses omniauth to authenticate visitors via facebook. When

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.