[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby interface to gnu date handling library?

Booker C. Bense

12/14/2004 3:07:00 PM

-----BEGIN PGP SIGNED MESSAGE-----

_ First, my apologies. I know I should be able to "just find
this", but my google-fu seems lacking this morning. There is a
library that allows you to use strings like

"last week"
"two hours ago"

to specify dates, I am looking for a ruby interface to that
library. If you remember the name of that library it would be
a great help as well.

_ Booker C. Bense

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBQb8Br2TWTAjn5N/lAQH/bgP9F4hyU5Kybdsw6YTUlQFGjeccJLbpeXIG
n/1SYl8mQf7A6BmjGO6uSShMKg7sfR5r055Jw4S5F7302emyxulL713lM9cH+3KV
3sP9bvrct4u6D5v7MZkuQfGHNegOaapfic1fApJEv8GYvbZeCfozOVdNCq1c/8cp
2d/PFFBeqFM=
=85Co
-----END PGP SIGNATURE-----
4 Answers

Hans Fugal

12/14/2004 3:25:00 PM

0

Booker C. Bense wrote:
> _ First, my apologies. I know I should be able to "just find
> this", but my google-fu seems lacking this morning. There is a
> library that allows you to use strings like
>
> "last week"
> "two hours ago"
>
> to specify dates, I am looking for a ruby interface to that
> library. If you remember the name of that library it would be
> a great help as well.
>
> _ Booker C. Bense

I googled for this the other day too, and failed. My application will
run in POSIX environments with the date command, so I just did this:

Time.parse(`date -d "#{date_string}"`)

Booker C. Bense

12/14/2004 6:08:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----

In article <cpn0jm$j8j$1@news.xmission.com>,
Hans Fugal <fugalh@xmission.com> wrote:
>Booker C. Bense wrote:
>> _ First, my apologies. I know I should be able to "just find
>> this", but my google-fu seems lacking this morning. There is a
>> library that allows you to use strings like
>>
>> "last week"
>> "two hours ago"
>>
>> to specify dates, I am looking for a ruby interface to that
>> library. If you remember the name of that library it would be
>> a great help as well.
>>
>> _ Booker C. Bense
>
>I googled for this the other day too, and failed. My application will
>run in POSIX environments with the date command, so I just did this:
>
>Time.parse(`date -d "#{date_string}"`)

_ Thanks, that will work just fine. I couldn't even remember what
command used this kind of date string. I guess I picked the wrong
week to cut back on my coffee consumption %-).

_ Booker C. Bense


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBQb8sCmTWTAjn5N/lAQF9RwP9H02Pih2C09saUVyGJPai3dNvUKFWbEPg
UfZy02Zpa06MlhcldNssc17aJaZbdpBZWCYJBjCYRBtEj5qzlqkxKMPKnCMe/CeI
8+11wlyKWobZ+23E95dLUUC4LOrwxCkSAckGI4hm7RnTRlH6WU65EDtJr78T5741
Cs2e1m9oTM8=
=8Iy4
-----END PGP SIGNATURE-----

Kaspar Schiess

12/15/2004 5:48:00 PM

0

"Booker C. Bense" <bbense+comp.lang.ruby.Dec.14.04
@telemark.slac.stanford.edu> wrote in news:cpna6b$ohq$1@news.Stanford.EDU:

> _ Thanks, that will work just fine. I couldn't even remember what
> command used this kind of date string. I guess I picked the wrong
> week to cut back on my coffee consumption %-).

Good luck with cutting back on coffee; I actually do the reverse. No wonder
that my googling did have the desired effects...

Download the first and last release of ruby-getdate here:
http://www.tua.ch/ruby/getdate/ruby-g...

And read all about it here:
http://www.tua.ch/ruby/cu...

This is really just the tiniest wrapper... And it might not even be up to
date. I feel lazy tonight. You can own the project if you feel inclined to
do so.

best regards, and lots of fun,
kaspar

hand manufactured code - www.tua.ch/ruby



Booker C. Bense

12/15/2004 10:31:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----

In article <Xns95C0BFBD38BF0eulespacech@80.91.229.5>,
Kaspar Schiess <eule@space.ch> wrote:
>"Booker C. Bense" <bbense+comp.lang.ruby.Dec.14.04
>@telemark.slac.stanford.edu> wrote in news:cpna6b$ohq$1@news.Stanford.EDU:
>
>Download the first and last release of ruby-getdate here:
>http://www.tua.ch/ruby/getdate/ruby-g...

_ Thanks, turns out I'll need it after all.

_ Booker C. Bense

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBQcC7LGTWTAjn5N/lAQHXiwQAgcX38/Gz/76MbYHtWFegsij5gp4IPhVy
Yd0yeeWwkcTK/z3TklsjaDq+rp1KiivIqpZfPcRgD4BihJ+T7rAD8p/aymgOrNiI
oBwaFJ6dTgcyvrqS7n1NTpphVbfnQYCAYsJ7J7d/W3WoRP6E6CKLaYXnaMtdbiKo
DcxcYD/rp8c=
=f1rh
-----END PGP SIGNATURE-----