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-11
:db
2026-02-11 18:50:02
20260211
:number
20260211185002
:time
18:50
11 Feb
:short
11 Feb 18:50
February 11, 2026
:long
February 11, 2026 18:50
February 11th, 2026
:long_ordinal
February 11th, 2026 18:50
11 Feb 2026
:rfc822
Wed, 11 Feb 2026 18:50:02 +0000
:iso8601
2026-02-11T18:50:02+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s