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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:02:30+00:00 2026-05-14T04:02:30+00:00

My Rails application makes use of Time.zone so that each user can set their

  • 0

My Rails application makes use of Time.zone so that each user can set their own timezone and see timestamps in the correct zone. However, I would like to have some content that is only available for one day, but for that one day to be the same 24 hours for all users.

In order to do that, I was going to use if Time.zone.today == Time.zone.local(year, month, day).to_date, but obviously that will just check the 24 hours that the day is the same in the current (ie. users’) timezone.

Is there any way to do this without having to change Time.zone to the timezone I want to use first?

  • 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-14T04:02:30+00:00Added an answer on May 14, 2026 at 4:02 am

    Just don’t use the Time.zone, use server time. There isn’t any need to get into what time the user thinks it is if you only want it to be the same 24 hours for everybody.

    if Time.today == Time.local(year, month, day).to_date
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got the following situation A rails application that makes use of rjs /
I have ab iPhone application that makes heavy use of a Rails json API
I am currently develoing a Rails application which makes heavy use of some javascript
I am running Ruby on Rails 3 and I have an application that makes
I'm using Ruby on Rails to make an application where businesses can create accounts
I have a rails application that about 3 years old, and I'm having a
We are writing a Rails application that is using CouchDB as its data store.
I have a card-game application which makes use of Single Table Inheritance. I have
I'm trying to use setup the rails application on apache2 using the virtual server
I have a rails application and i need to get the Eastern standard Time

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.