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