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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:17:10+00:00 2026-05-31T23:17:10+00:00

From my last question , I now know how to get access to the

  • 0

From my last question, I now know how to get access to the tzinfo gem. However I don’t know how to use it for my purposes.

Suppose I need to send an email to a person in Bujumbura, Burundi every morning at 8:00 AM in whatever combination of timezone and daylight savings that applies to Bujumbura every day. My understanding is that tzinfo “knows” the information. Is it possible to convert 8:00 AM Bujumbura time (including daylight savings) into UTC for every day of the year? I would like to do something like:

require 'tzinfo'
bz = TZInfo::Timezone.get('Africa/Bujumbura')
#bujumbura_time=????
bujumbura_utctime=tz.local_to_utc(bujumbura_time)

How do I encode “bujumbura_time” to reflect that it is 8:00 AM in Bujumbura time?

  • 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-31T23:17:11+00:00Added an answer on May 31, 2026 at 11:17 pm

    I don’t believe you need to make bujumbura_time aware of a specific time zone. Instead, you create a local time which can then be converted to UTC in conjunction with the time zone:

    require 'tzinfo'
    bz = TZInfo::Timezone.get('Africa/Bujumbura')
    bujumbura_time = Time.local(2012, 3 ,27, 8, 0, 0)
    bujumbura_utctime = bz.local_to_utc(bujumbura_time)
    

    Note that converting from local time to UTC can be awkward due to daylight savings – when the clocks go forward, an hour (typically) of local time is skipped entirely, and when the clocks go back, a portion of local time occurs twice. You should work out what you want to happen in those situations. (The local_to_utc documentation explains your options.)

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

Sidebar

Related Questions

Learning from my last question , most member names seem to get included in
Hopefully the last NN question you'll get from me this weekend, but here goes
Following from my last question which @Jon Skeet gave me a lot of help
Following on from my last question What is a Stub , I would really
You may notice from my last question that a problem caused some more problems,
I have gotten a great deal of help from KandadaBoggu on my last question
I am working on C++ and COM/ATL in Windows from last few years. Now
I want to use greasemonkey to scrape wiki data from Last.fm (this is not
Following on from my last question on optimization I'm finding it easier to believe
Again a SED question from me :) So, same as last time, I'm wrestling

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.