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-13
:db
2026-02-13 19:09:18
20260213
:number
20260213190918
:time
19:09
13 Feb
:short
13 Feb 19:09
February 13, 2026
:long
February 13, 2026 19:09
February 13th, 2026
:long_ordinal
February 13th, 2026 19:09
13 Feb 2026
:rfc822
Fri, 13 Feb 2026 19:09:18 +0000
:iso8601
2026-02-13T19:09:18+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s