On Jul 6, 2006, at 6:09 PM, sail wrote:
> tanks
>
> Tom Ward & Rob Biedenharn
>
> that works very well.
>
> but i have a new question more complex for you...
>
> how can i get the value double of a date.
>
> for example in visualbasic today is
> cdbl(date) = 38904
>
Assuming that the "value double of a date" is like the number of days
since some date in the past, you could do:
>> require ''date''
=> true
>> Date.today.jd - 38904
=> 2415019
>> class Date
>> def cdbl(start=2415019)
>> self.jd - start
>> end
>> end
=> nil
>> Date.today.cdbl
=> 38904
Then tomorrow will be:
>> Date.today.succ.cdbl
=> 38905
I suppose that''s what you''re asking, but perhaps you need to
step
back and think about what you are really trying to accomplish. (And
if a direct translation from visualbasic is the right thing to do.)
-Rob