Reputation: 7862
How can I transform Date.today object to return the date in format MMDD
?
For instance, for today, this should be:
0304
Upvotes: 0
Views: 89
Reputation: 51151
You should use strftime
method:
Date.today.strftime('%d%m')
# => "0304"
Upvotes: 1