LANGUAGE » RUBY

Time

Basic

ruby
now = Time.now

Get a string representation of a date in the specified format. Check here for all the formatting options.

ruby
now.strftime('%Y-%m-%d %H:%M:%S')