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-07-10
:db
2025-07-10 13:51:01
20250710
:number
20250710135101
:time
13:51
10 Jul
:short
10 Jul 13:51
July 10, 2025
:long
July 10, 2025 13:51
July 10th, 2025
:long_ordinal
July 10th, 2025 13:51
10 Jul 2025
:rfc822
Thu, 10 Jul 2025 13:51:01 +0000
:iso8601
2025-07-10T13:51:01+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s