Rails has some awesome date & time methods.
Here’s a few to get the previous date.
# Ruby
Date.today.prev_day
# Rails
Date.yesterday
1.day.ago
Date.today - 1.day
Related External Links:
Rails has some awesome date & time methods.
Here’s a few to get the previous date.
# Ruby
Date.today.prev_day
# Rails
Date.yesterday
1.day.ago
Date.today - 1.day
Related External Links:
Article Topic:Software Development - Rails
Date:February 15, 2016
Want me to help develop your next Ruby-on-Rails project or application?
Contact Me