Format.rb
This content was produced by an LLM and could include errors.
This script captures the current time into a variable t. It then uses the strftime method to format this time object, extracting and displaying only the date in YYYY-MM-DD format.
t = Time.now
#=> 2026-06-24 17:12:55.338707321 +0000
t.strftime("%F")
#=> "2026-06-24"
Ruby 4.0.5