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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:41:20+00:00 2026-06-03T09:41:20+00:00

Apologies if the title is not clear, I’ not really sure how to explain

  • 0

Apologies if the title is not clear, I’ not really sure how to explain this clearly.

In a Rails app I’m pulling in users’ data from a 3rd party provider’s API. One of the attributes is the user’s birthday.

I am storing the hashed data in my database and, in certain circumstances, need to display the user’s birthday in the view.

The problem is that the birthday is not formatted as a Date. Within the hash, it is in the format mm/dd/yyyy. This means that my usual date scoped formats don’t work on it.

Given that I am extracting the birthday from the hashed data column as follows

<%= @user.hashed_data["info"]["birthday"] %>

what is the best/ most efficient way to handle this so that I can display localized date formats?

Do I need to split on the / symbols, and then recombine the resulting string to a date? Or am I overcomplicating this?

Thanks for any suggestions.

  • 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-03T09:41:21+00:00Added an answer on June 3, 2026 at 9:41 am

    Try:

    Date.strptime('01/31/2011', '%m/%d/%Y') 
    # => #<Date: 2011-01-31 (4911185/2,0,2299161)>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apologies for the terrible title, not really sure how to explain this without a
My apologies for an inaccurate title, but I'm not sure what this is called
(Apologies for the title of this question - I wasn't overly sure how to
Apologies for the vague title, but this is quite a difficult problem to explain
Firstly, apologies for the vague title, but I'm not sure exactly what I'm asking
I wasn't sure how to word the title to this well, apologies if the
I'm not sure if my question title describes my situation aptly, so my apologies
Firstly, apologies for the bad question title - not entirely sure if I am
Apologies for the poor question title - I'm not sure how to describe what
I am not sure if this makes sense so apologies before hand: is there

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.