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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:06:13+00:00 2026-06-01T14:06:13+00:00

I need to Monkey patch strftime in Ruby 1.8.7 with Rails 2.3 on Windows.

  • 0

I need to Monkey patch strftime in Ruby 1.8.7 with Rails 2.3 on Windows. In config\initializers I put this time_patch.rb file (code below) but it does not seem to be picking up:

if RUBY_PLATFORM =~ /mingw32|mingw64|mswin32|mswin64/

  class Time
    alias_method :original_strftime, :strftime
    def strftime(fmt)
      hour12 = "%2d" % ((hour + 11) % 12 + 1)
      original_strftime(fmt.gsub(/%l/, hour12))
    end
  end

end

I renamed the method to def blorping and did Time.methods from the Rails console but did not see the new method.

What do I need to do to get it to work?

  • 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-01T14:06:14+00:00Added an answer on June 1, 2026 at 2:06 pm

    You’re checking the class methods when using Time.methods, so what you want is something like Time.instance_methods to be sure it’s patched correctly.

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

Sidebar

Related Questions

Dont worry we dont need to find out any bug in this code. Its
I am new to Grease Monkey and I need to click this Delete button
I need help getting a Grease Monkey with JQuery Script to run on a
I'm new to rails and making some sort of noob mistake: I frequently need
I would like to put an int into a string . This is what
I wrote the following code under the assumption that Excel will die with Monkey:
I have the following html code in my application: <tr style=cursor:pointer;> <td>100101</td> <td>Monkey</td> <td>Nuts<td>
I need to convert a rails 2.3 site so that all external URLs open
I'm a new code monkey in training, and I'm currently having issues working with
I don't understand this. I need to solve seemingly simple problem, and yet it's

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.