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-11
:db
2026-03-11 16:53:56
20260311
:number
20260311165356
:time
16:53
11 Mar
:short
11 Mar 16:53
March 11, 2026
:long
March 11, 2026 16:53
March 11th, 2026
:long_ordinal
March 11th, 2026 16:53
11 Mar 2026
:rfc822
Wed, 11 Mar 2026 16:53:56 +0000
:iso8601
2026-03-11T16:53:56+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s