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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:37:16+00:00 2026-05-26T02:37:16+00:00

I’m completely new to ruby and I’m trying to format the created_at field pulled

  • 0

I’m completely new to ruby and I’m trying to format the created_at field pulled in from the Twitter gem. I know in rails you can use time_ago_in_words for rails, but I was wondering how you can do this in plain ruby. Infact I’m wondering how you can format a date which is in this format to start with “Mon, 10 Oct 2011 20:13:10 +0000”. Is this the standard date format?

Any help would be brilliant.

  • 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-26T02:37:17+00:00Added an answer on May 26, 2026 at 2:37 am

    If you’re using Ruby 1.9, Time.parse understands your format just fine:

    ruby-1.9.2-p180 :003 > t = Time.parse("Mon, 10 Oct 2011 20:13:10 +0000")
     => 2011-10-10 23:13:10 +0300 
    ruby-1.9.2-p180 :004 > t.month
     => 10 
    ruby-1.9.2-p180 :005 > t.strftime("%d-%m-%Y")
     => "10-10-2011" 
    

    In 1.8, DateTime has a similar method:

    irb(main):004:0> require 'date'
    => true
    irb(main):006:0> t = DateTime.parse("Mon, 10 Oct 2011 20:13:10 +0000")
    => #<DateTime: 2011-10-10T20:13:10+00:00 (21218503759/8640,0/1,2299161)>
    irb(main):007:0> t.month
    => 10
    

    If you want to implement distance_of_time_in_words by yourself, the best starting point is probably to check out its source (click the view source link on that page).

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

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.