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-05
:db
2026-02-05 00:04:50
20260205
:number
20260205000450
:time
00:04
05 Feb
:short
05 Feb 00:04
February 05, 2026
:long
February 05, 2026 00:04
February 5th, 2026
:long_ordinal
February 5th, 2026 00:04
05 Feb 2026
:rfc822
Thu, 05 Feb 2026 00:04:50 +0000
:iso8601
2026-02-05T00:04:50+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s