Tsallaka zuwa abun ciki
Justice Tech School

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).day

Result

2026
3
2026-03-15 10:30
0
16

Exercise

Format time.

t.("%Y")

Quiz Test

What does t + 86400 add?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.