how to convert a "%d/%m/%Y" date to a "%Y/%m/%d" date?
if it''s a string then use the the split function. split it up by the /. It should return 3 values after being split... the day, the month, and the year. Then rearrange them. On Jul 18, 2006, at 5:29 AM, Fernando wrote:> how to convert a "%d/%m/%Y" date to a "%Y/%m/%d" date? > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Ben Lisbakken wrote:> if it''s a string then use the the split function. split it up by > the /. It should return 3 values after being split... the day, the > month, and the year. Then rearrange them.or you can just use date_object.strftime("%Y/%m/%d") and that should do the trick. cheers, s -- Posted via http://www.ruby-forum.com/.