[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

[chronic] last day in month

Daniel Liebig

1/25/2007 9:41:00 PM

Hi,

i'm trying to get the last day of a month with chronic. Since chronic
seems to use 'last' as keyword in a sence like "back from now" this
does't give a result

Chronic.parse("last day of this month")

i tried also 'latest' and 'end' instead of 'last' with no result. I
couldn't find an appropriate example in the documentation
http://chronic.ruby... , neither i could find an exact
documentation of all valid keywords.

Any hints?

Thx for any help
Regards
Daniel
3 Answers

Morton Goldberg

1/25/2007 10:54:00 PM

0

On Jan 25, 2007, at 4:45 PM, Daniel Liebig wrote:

> Hi,
>
> i'm trying to get the last day of a month with chronic. Since
> chronic seems to use 'last' as keyword in a sence like "back from
> now" this does't give a result
>
> Chronic.parse("last day of this month")
>
> i tried also 'latest' and 'end' instead of 'last' with no result. I
> couldn't find an appropriate example in the documentation http://
> chronic.rubyforge.org/ , neither i could find an exact
> documentation of all valid keywords.
>
> Any hints?

Just guessing, but you might try "day before 1st day of next month".

Regards, Morton



Gavin Kistner

1/25/2007 11:12:00 PM

0

On Jan 25, 3:53 pm, Morton Goldberg <m_goldb...@ameritech.net> wrote:
> On Jan 25, 2007, at 4:45 PM, Daniel Liebig wrote:
> > i'm trying to get the last day of a month with chronic. Since
> > chronic seems to use 'last' as keyword in a sence like "back from
> > now" this does't give a result
> > Any hints?
>
> Just guessing, but you might try "day before 1st day of next month".

Close:
irb(main):005:0> Chronic.parse( '1 day before first day of January')
=> Sun Dec 31 12:00:00 -0700 2006

Tom Werner

1/25/2007 11:25:00 PM

0

Daniel Liebig wrote:
> Hi,
>
> i'm trying to get the last day of a month with chronic. Since chronic
> seems to use 'last' as keyword in a sence like "back from now" this
> does't give a result
>
> Chronic.parse("last day of this month")
>
> i tried also 'latest' and 'end' instead of 'last' with no result. I
> couldn't find an appropriate example in the documentation
> http://chronic.ruby... , neither i could find an exact
> documentation of all valid keywords.
>
> Any hints?
>
> Thx for any help
> Regards
> Daniel
>
>
Chronic.parse('1 day before next month', {:guess => false})
=> Wed Jan 31 00:00:00 -0800 2007..Wed Feb 28 00:00:00 -0800 2007

Chronic.parse('1 day before next month', {:guess => false}).begin
=> Wed Jan 31 00:00:00 -0800 2007

Which is a little weird because generally you're not asking for
distances in smaller units than the anchor, but it still works. =)

Tom