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-28
:db
2026-02-28 21:09:33
20260228
:number
20260228210933
:time
21:09
28 Feb
:short
28 Feb 21:09
February 28, 2026
:long
February 28, 2026 21:09
February 28th, 2026
:long_ordinal
February 28th, 2026 21:09
28 Feb 2026
:rfc822
Sat, 28 Feb 2026 21:09:33 +0000
:iso8601
2026-02-28T21:09:33+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s