Find Current Month ?

HI Folks,

How to find current month?


How to collect current month data from our database?

Please advice.

Thank You.

I'm not trying to be a dick, but these are fundamental tasks that you
should have learned first.

[1] pry(main)>"%B") #=> "January"
[2] pry(main)>"%b") #=> "Jan"
[3] pry(main)> #=> 1

As for the latter, that's a hard question to ask, because I would not
query by date the Rails way, I would opt to use PG functions to format
the date and query that way so without knowing a database I cannot
help there but it's not hard to use where("created_at >= ?",
5.days.ago) though I don't even know if that's a good way to do it in
Rails because again I would never do date queries directly in Rails.