E
E
eldar_web2015-05-22 16:46:15
Ruby on Rails
eldar_web, 2015-05-22 16:46:15

How to get day or month from date in Rails?

I store date of format dd.mm.yyyy in the table of String format.
Am I doing the right thing?
And if so, then I want to display the day, month or year from a specific date.
How can I do that?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Viktor Vsk, 2015-05-22
@viktorvsk

Sorry, after this question ( Judging by the questions in the Rails topic, people just don't read manuals? ) I'm ashamed to read in the mail that they ask me to help, as an expert in this matter :) Have you
tried searching here ?

R
Robert, 2015-05-22
@Jowan

date = Time.now
date.day ==> day
date.month ==> month
And so on. It's all in the docs ;)

C
caution, 2015-05-22
@caution

and the questions have really gone down to idiotic ones and are googled with the first request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question