From: Dhruva Sagar Date: 2010-10-16T17:33:21+09:00 Subject: Re: Is this an executable code? --005045013e1b1b8c2f0492b7cb2e Content-Type: text/plain; charset=UTF-8 Hi, well that is the syntax for using the method 'local'. The syntax mentioned in the book is showing you how to use the method and what the arguments you are supposed to pass to it in order to achieve what you have to. In place of the arguments you have to put in real values when you are actually using the method. You could assign those values to variables and then pass those variables to the method. When you just type that in IRB, when it interprets the call, it tries to resolve the values like 'year', 'month' etc. Since they have not been defined, it outputs the error that the local variable hasn't been defined. in IRB if you did : irb> year = '2009' irb> month = '01' . . . irb> Time.local(year, month....) then it will work as you'd expect it to again. PS : If you do not have programming background, I suggest you go through a book targetting beginners like yourself and get a hold of the basics of ruby programming. -- Thanks & Regards, Dhruva Sagar. On Sat, Oct 16, 2010 at 13:41, Kaye Ng wrote: > I think I get it now. I typed Time.local(2010,10,16,15,50,33) > and IRB returned with values of year, month, day, hour, min, and sec in > that order, with the values of the arguments passed to 'local'. > > But the code sample from the book I'm reading has the msec argument. > Time.local(year, month, day, hour, min, sec, msec) > I added another argument for the msec position but IRB returned with the > same result as the previous, as if I didn't add the msec argument in > there. Why is that? > > > Sorry, beginner here and no background in programming whatsoever. > > -- > Posted via http://www.ruby-forum.com/. > > --005045013e1b1b8c2f0492b7cb2e--