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-20
:db
2026-02-20 21:18:35
20260220
:number
20260220211835
:time
21:18
20 Feb
:short
20 Feb 21:18
February 20, 2026
:long
February 20, 2026 21:18
February 20th, 2026
:long_ordinal
February 20th, 2026 21:18
20 Feb 2026
:rfc822
Fri, 20 Feb 2026 21:18:35 +0000
:iso8601
2026-02-20T21:18:35+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s