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-03-09
:db
2026-03-09 14:16:02
20260309
:number
20260309141602
:time
14:16
09 Mar
:short
09 Mar 14:16
March 09, 2026
:long
March 09, 2026 14:16
March 9th, 2026
:long_ordinal
March 9th, 2026 14:16
09 Mar 2026
:rfc822
Mon, 09 Mar 2026 14:16:02 +0000
:iso8601
2026-03-09T14:16:02+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s