In Perl you can do:
my $current_time = DateTime->now(); my $mdy = $current_time->mdy("/");
What's the easiest way to do this in Ruby?
The strftime method can be used to format times:
strftime
Time.now.strftime("%m/%d/%Y")
2.1m questions
2.1m answers
60 comments
57.0k users