[chronic] last day in month

D

Daniel Liebig

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?

Thx for any help
Regards
Daniel
 
M

Morton Goldberg

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
 
P

Phrogz

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
 
T

Tom Werner

Daniel said:
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?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top