Time.zone.now.to_fs(:symbol)
Time.zone.now.to_formatted_s(:symbol)
pre-Rails 7
Time.zone.now.to_s(:symbol)
date
:symbol
time
2007-11-10
:db
2007-01-18 12:34:56
20071110
:number
20070118123456
:time
12:34
10 Nov
:short
18 Jan 12:34
November 10, 2007
:long
January 18, 2007 06:10
November 10th, 2007
:long_ordinal
January 18th, 2007 06:10
10 Nov 2007
:rfc822
Thu, 18 Jan 2007 06:10:17 -0600
:iso8601
2007-01-18T06:10:17-06:00
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s