From: David Douthitt Date: 2000-04-05T09:50:59-05:00 Subject: [ruby-talk:02362] Re: crontab I wrote a really SIMPLE version which matches MonTueWedThuFriSatSunNoneAllWeekdayWeekend although it doesn't account for conflicting entries (MonTueFriNone -or- AllWeekday, etc.) class Time def Time.datein (str) dayx = Time.now.wday wdays = %w(Sun Mon Tue Wed Thu Fri Sat) weekday = (dayx > 0 && dayx < 6) weekend = ! weekday ( ((str =~ /(#{wdays[dayx]}|^All$|^ *$)/) != nil) || (((str =~ "^Weekday$") !=nil) && weekday) || (((str =~ "^Weekend$") !=nil) && weekend) ) end end >>> Hugh Sasse Staff Elec Eng 04/05/00 09:24AM >>> I want to have a program that may be run between certain times. It seems silly to invent a format to specify the start and end times when I can use that from crontab. So, has anyone already produced code that will tell if "now" matches a crontab entry, using Ruby? Thank you, Hugh hgs@dmu.ac.uk