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
2026-02-07
:db
2026-02-07 12:24:15
20260207
:number
20260207122415
:time
12:24
07 Feb
:short
07 Feb 12:24
February 07, 2026
:long
February 07, 2026 12:24
February 7th, 2026
:long_ordinal
February 7th, 2026 12:24
07 Feb 2026
:rfc822
Sat, 07 Feb 2026 12:24:15 +0000
:iso8601
2026-02-07T12:24:15+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s