Format.rb

This content was produced by an LLM and could include errors.

このスクリプトは現在時刻を Time.now で取得し、strftime("%F") によりISO 8601の日付部分 YYYY-MM-DD(例: 2026-08-22)へ整形して表示します。%F%Y-%m-%d の省略形です。

t = Time.now
#=> 2026-08-22 01:20:06.179261918 +0000
t.strftime("%F")
#=> "2026-08-22"

Ruby 4.0.6