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
2025-10-18
:db
2025-10-18 02:18:08
20251018
:number
20251018021808
:time
02:18
18 Oct
:short
18 Oct 02:18
October 18, 2025
:long
October 18, 2025 02:18
October 18th, 2025
:long_ordinal
October 18th, 2025 02:18
18 Oct 2025
:rfc822
Sat, 18 Oct 2025 02:18:08 +0000
:iso8601
2025-10-18T02:18:08+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s