Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

to_date, to_time, and to_datetime Time methods present in ruby 1.9 #4432

merged 1 commit into from Jan 12, 2012


None yet
3 participants

lest commented Jan 12, 2012

No description provided.

@spastorino spastorino added a commit that referenced this pull request Jan 12, 2012

@spastorino spastorino Merge pull request #4432 from lest/patch-1
to_date, to_time, and to_datetime Time methods present in ruby 1.9

@spastorino spastorino merged commit 31472ba into rails:master Jan 12, 2012


mitio commented on b8e1efd Mar 13, 2012

@lest could you please help me understand where does the Ruby core library define, for example, Time#to_date?

I checked core-1.9.2, core-1.9.3 and core-2.0 Time docs and I don't see #to_date defined there. I also tested in 1.9.3-p0 for Time#to_date, but it's not there.

Maybe I'm missing something?


lest replied Mar 13, 2012

It's implemented in date extension. Here is example https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c#L9281.
Time#to_date method becomes available when date is required.


mitio replied Mar 13, 2012

I see, thanks for clarifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment