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-24
:db
2026-02-24 18:18:39
20260224
:number
20260224181839
:time
18:18
24 Feb
:short
24 Feb 18:18
February 24, 2026
:long
February 24, 2026 18:18
February 24th, 2026
:long_ordinal
February 24th, 2026 18:18
24 Feb 2026
:rfc822
Tue, 24 Feb 2026 18:18:39 +0000
:iso8601
2026-02-24T18:18:39+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s