Mode:
Duration:
1
2
3
4
5
6
7
8
9
require 'date'
now = Time.now
puts "Current time: #{now}"
puts "Formatted: #{now.strftime("%A, %d %B %Y %I:%M %p")}"
birthday = Date.new(2000, 5, 12)
age = ((Date.today - birthday).to_i / 365.25).floor
puts "Age based on DOB #{birthday}: #{age} years"Coding works best on desktop or with an external keyboard.