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-15
:db
2026-02-15 13:44:44
20260215
:number
20260215134444
:time
13:44
15 Feb
:short
15 Feb 13:44
February 15, 2026
:long
February 15, 2026 13:44
February 15th, 2026
:long_ordinal
February 15th, 2026 13:44
15 Feb 2026
:rfc822
Sun, 15 Feb 2026 13:44:44 +0000
:iso8601
2026-02-15T13:44:44+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s