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-11-29
:db
2025-11-29 19:48:23
20251129
:number
20251129194823
:time
19:48
29 Nov
:short
29 Nov 19:48
November 29, 2025
:long
November 29, 2025 19:48
November 29th, 2025
:long_ordinal
November 29th, 2025 19:48
29 Nov 2025
:rfc822
Sat, 29 Nov 2025 19:48:23 +0000
:iso8601
2025-11-29T19:48:23+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s