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-04-25
:db
2025-04-25 06:13:47
20250425
:number
20250425061347
:time
06:13
25 Apr
:short
25 Apr 06:13
April 25, 2025
:long
April 25, 2025 06:13
April 25th, 2025
:long_ordinal
April 25th, 2025 06:13
25 Apr 2025
:rfc822
Fri, 25 Apr 2025 06:13:47 +0000
:iso8601
2025-04-25T06:13:47+0000
date source
time source
This code paraphrases the #to_formatted_s docs.
#to_formatted_s