The ruby code to find which weekday is current day
At first, I failed to find which weekday is today by following codes:
timetoday = Time.now
if timetoday =~ /Fri/
puts “Friday”
end
I found in the internet that following codes works:
timetoday = ” ”
timetoday = Time.now.to_s()
if timetoday =~ /Fri/
puts “Friday”
end