Re: [Rails] date problem in ruby
On 2 February 2012 09:06, amvis <vgrkrishnan@gmail.com> wrote:
>
> now am selecting one date from table, so from that date i have to retrieve
> the day of week, day of month,year... Some ways i have tried but didn't get
> that, actually i had tried with current date.
>
> time = Time.new
> time.wday
> time.month..
>
> so how to pass one date,which is from table and find the above stuffs..?
are you saying that time.wday did not work?
$ irb
ruby-1.8.7-p302 > time=Time.new
=> Thu Feb 02 09:11:24 +0000 2012
ruby-1.8.7-p302 > time.wday
=> 4
ruby-1.8.7-p302 > time.month
=> 2
ruby-1.8.7-p302 >
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home