How to convert months into days in ruby?

318 views
Skip to first unread message

Vikas Gholap

unread,
Sep 23, 2009, 2:23:36 AM9/23/09
to rubyonra...@googlegroups.com
Hello,

How to convert months to days in ruby?

I want for example

6 months = total days of next 6 months from todays date.

How i do that?

Thanks,

Vikas
--
Posted via http://www.ruby-forum.com/.

Abhinav Saxena

unread,
Sep 23, 2009, 2:49:34 AM9/23/09
to rubyonra...@googlegroups.com
I don't know how to do it, but see if Chronic might be of some use http://chronic.rubyforge.org/

Thanks,
Abhinav
--
अभिनव
http://twitter.com/abhinav

Brijesh Shah

unread,
Sep 23, 2009, 2:52:48 AM9/23/09
to rubyonra...@googlegroups.com
Vikas Gholap wrote:
> Hello,
>
> How to convert months to days in ruby?
>
> I want for example
>
> 6 months = total days of next 6 months from todays date.
>
date_today=Date.today
date_next =Date.today.advance(:months=>6)

(date_next - date_now).to_i given result in days...

Vikas Gholap

unread,
Sep 23, 2009, 3:11:54 AM9/23/09
to rubyonra...@googlegroups.com
Brijesh Shah wrote:
> Vikas Gholap wrote:
>> Hello,
>>
>> How to convert months to days in ruby?
>>
>> I want for example
>>
>> 6 months = total days of next 6 months from todays date.
>>
> date_today=Date.today
> date_next =Date.today.advance(:months=>6)
>
> (date_next - date_now).to_i given result in days...

Thanks Brijesh.

Reply all
Reply to author
Forward
0 new messages