Archive

Archive for June, 2009

The ruby code to find which weekday is current day

June 10th, 2009 No comments

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

Categories: ruby Tags: