Quick reference for efficient coding
The overall purpose of the code is to capture the current date and time and then convert it into a string formatted as “YYYY-MM-DD”.
t = Time.now
#=> 2024-10-10 15:57:31.02728735 +0000
t.strftime("%F")
#=> "2024-10-10"
Executed with Ruby 3.3.5