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

  • SEARCH
  • Home
  • 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 8281429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:01:47+00:00 2026-06-08T10:01:47+00:00

In a web application I’m developing (Ruby on Rails), the user can specify a

  • 0

In a web application I’m developing (Ruby on Rails), the user can specify a local time of any location in the world.
(That location is nothing to do with the user’s location or the server’s location.)

And if Daylight Savings time is used at that location, the user types that time.
I need to get the local time without Daylight Savings for the location from the specified Daylight Savings time.

e.g. The server is in San Francisco. The user is in New York. In winter, the user enters the local time during summer (with Daylight Savings) of Minneapolis. And I need to get the equivalent local time of Minneapolis without Daylight Savings offset. Suppose that we don’t have information if Daylight Savings Time is used in Minneapolis or not.

Because the user can specify any location in the world, we cannot tell if that location uses Daylight Savings Time. Also the UTC offset information itself doesn’t tell if it’s in Daylight Savings Time or not.

How can I do this?

Any help will be greatly appreciated?

  • 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-06-08T10:01:49+00:00Added an answer on June 8, 2026 at 10:01 am

    The olson TZ database (available via the tzinfo gem) does contain information about whether each location uses daylight savings or not (and when that period starts/finishes). You should usually use the timezone objects it provides rather than raw utc offsets. When you’ve got a timezone object the local_to_utc method will do the conversion for you, applying DST as appropriate.

    The only ambiguous case is when the clocks go back: there is one hour a year during which the local time can correspond to two distinct points in time. In the uk for example at the end of October the clocks go back one hour at 1:59:59 – if a user tells you the local time 1:30:00 you won’t know if it is the first or second 1:30. Tzinfo can tell you both of the possibilities so that you can pick based in your own logic.

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

Sidebar

Related Questions

My web application sets session every time a user logs in. I checked that
The web application that I am developing right now has something called quiz engine
The web application that I am developing right now has something called quiz engine
Our web application allows users to specify their own slugs which can include relative
In web application [asp.net] shall we write code that can retrive data from datbase
My web application operates only over SSL and sets a time limited cookie for
In web application, i am created one new project in that i added class
The web application I'm currently developing supports CSV export from (using SELECT INTO OUTFILE)
The web application we are developing allows developers to do an HTTP POST from
My web application uses a native dll for part of its functionality (the location

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.