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-17
:db
2026-02-17 22:19:47
20260217
:number
20260217221947
:time
22:19
17 Feb
:short
17 Feb 22:19
February 17, 2026
:long
February 17, 2026 22:19
February 17th, 2026
:long_ordinal
February 17th, 2026 22:19
17 Feb 2026
:rfc822
Tue, 17 Feb 2026 22:19:47 +0000
:iso8601
2026-02-17T22:19:47+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s