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-09
:db
2026-02-09 16:25:51
20260209
:number
20260209162551
:time
16:25
09 Feb
:short
09 Feb 16:25
February 09, 2026
:long
February 09, 2026 16:25
February 9th, 2026
:long_ordinal
February 9th, 2026 16:25
09 Feb 2026
:rfc822
Mon, 09 Feb 2026 16:25:51 +0000
:iso8601
2026-02-09T16:25:51+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s