Forum: Ruby on Rails String date parsing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
666768840d1cafcc08daf02fac30cdbb?d=identicon&s=25 Derek DeVries (Guest)
on 2006-01-16 04:00
(Received via mailing list)
Does anyone know if a Ruby package has been written to handle
functionality similar to php's strtotime(). I'm looking for something
that can parse almost any string (such as "1 day ago", "+1 week",
"last tuesday") into a timestamp.

I've played with ParseDate, but it doesn't seem to do what I need. Any
suggestions?

Derek
C8a634a01a2c4508360874bff7fb1a7f?d=identicon&s=25 Kevin Olbrich (olbrich)
on 2006-01-16 04:06
Derek DeVries wrote:
> Does anyone know if a Ruby package has been written to handle
> functionality similar to php's strtotime(). I'm looking for something
> that can parse almost any string (such as "1 day ago", "+1 week",
> "last tuesday") into a timestamp.
>
> I've played with ParseDate, but it doesn't seem to do what I need. Any
> suggestions?
>
> Derek

I was looking into this a bit myself recently.  There are some SQL
functions in MySQL that might be helpful, but I haven't found a true
ruby implementation of this yet.

_Kevin
4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-01-16 04:24
(Received via mailing list)
Search the mail archives for this... someone just posted an announcement
in the last day
or so about a package they wrote that does this. It was pretty
impressive... understood
all your examples I think....

b
C8a634a01a2c4508360874bff7fb1a7f?d=identicon&s=25 Kevin Olbrich (olbrich)
on 2006-01-16 05:09
Ben Munat wrote:
> Search the mail archives for this... someone just posted an announcement
> in the last day
> or so about a package they wrote that does this. It was pretty
> impressive... understood
> all your examples I think....
>
> b

I think that was a JS date select widget.  While useful for interfaces,
I don't think you can easily use it for other purposes.

_Kevin
This topic is locked and can not be replied to.