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-05
:db
2026-03-05 15:53:02
20260305
:number
20260305155302
:time
15:53
05 Mar
:short
05 Mar 15:53
March 05, 2026
:long
March 05, 2026 15:53
March 5th, 2026
:long_ordinal
March 5th, 2026 15:53
05 Mar 2026
:rfc822
Thu, 05 Mar 2026 15:53:02 +0000
:iso8601
2026-03-05T15:53:02+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s