Ruby
# current time
Time.now # 2009-06-24 12:39:54 +0900
# Return Time string with certain format - dd-Mon-yyyy HH:MM am/pm
"%d-%b-%Y %-l:%M%P" # 27-Jan-2016 7:19am
"%d/%m/%Y %-l:%M%P" # 27/01/2016 7:19am
<%= Time.now.strftime("%m/%d/%Y") %>
<%= DateTime.now.strftime("%m/%d/%Y") %>
<%= DateTime.now.strftime("%e-%b-%Y %m:%M %p %Z") %>
# outputs - 12-Feb-2016 07:05 PM IST
Last modified 6mo ago