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-05-07 12:49:19.765373839 +0000
t.strftime("%F")
#=> "2026-05-07"

Ruby 4.0.3