From: John Mettraux Date: 2008-09-28T14:19:57+09:00 Subject: Re: Parsing a time span On Sun, Sep 28, 2008 at 1:08 PM, Eric Marthinsen wrote: > Oh, and it looks like Duration doesn't parse the way I want to, so any > other ideas would be much appreciated. Hi, I have something like that available from the "rufus-scheduler" gem : http://github.com/jmettraux/rufus-scheduler http://rufus.rubyforge.org/rufus-scheduler/classes/Rufus.html#M000006 ---8<--- require 'rubygems' require 'rufus/scheduler' Rufus.parse_time_string "500" # => 0.5 Rufus.parse_time_string "1000" # => 1.0 Rufus.parse_time_string "1h" # => 3600.0 Rufus.parse_time_string "1h10s" # => 3610.0 Rufus.parse_time_string "1w2d" # => 777600.0 --->8--- Best regards, -- John Mettraux - http://jmettraux.wordpress.com