Time
Time.now, Time.new and strftime handle dates.
Example
t = Time.new(2026, 3, 15, 10, 30)
puts t.year, t.month, t.strftime("%Y-%m-%d %H:%M"), t.wday
puts (t + 86400).dayResult
2026 3 2026-03-15 10:30 0 16
Exercise
Format time.
t.("%Y")
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.