Forum: Ruby on Rails How to change Date format

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
D69cd9081a425b5c8b5efa6b0633135c?d=identicon&s=25 Rahul Ha (aveo)
on 2007-04-23 11:44
Hi all,
I am using InstantRails with MySQL-Front. Date is stored in format
in database. I want to retrieve and show date in dd-mm-yyyy in my
How can I change it to dd-mm-yyyy form.
Please help me out.

C91098dc76d7ad473165ef24fe805312?d=identicon&s=25 Nanyang Zhan (xain)
on 2007-04-23 14:13
Rahul Ha wrote:

> How can I change it to dd-mm-yyyy form.
> Please help me out.

there may be a method to do this job,
at least you can code a helper yourself, like
def my_date(date)
Be45ffb84c0c25c351960879576ce315?d=identicon&s=25 o_O (Guest)
on 2007-04-23 14:16
(Received via mailing list)
<a href="
Time.html#M000264">strftime method</a>


On Apr 23, 11:44 am, Rahul Ha <>
34a7615f38496a5dafbb3e6b721c435e?d=identicon&s=25 Mohit Sindhwani (Guest)
on 2007-04-23 14:18
(Received via mailing list)
Nanyang Zhan wrote:
>  "#{}-#{date.month}-#{date.year}"
> end
If you just need to reformat the date object when you print it, look at
the strftime function in the API.

This topic is locked and can not be replied to.