From: Eric Hodel Date: 2007-02-03T03:21:20+09:00 Subject: Re: What's up with Time.local ? On Feb 2, 2007, at 09:58, Peter Bailey wrote: > I need to check some file dates against the budgetary periods of our > company, to determine where those files get placed. I'm playing > with the > Time.local object. I've proven that I can denote which budget > period I'm > in by using the .between? method. But, I get this weird "octal digit" > error with some of my date entries. > > irb(main):001:0> t = Time.local(2007,09,09,00,00) > SyntaxError: compile error > (irb):1: Illegal octal digit > t = Time.local(2007,09,09,00,00) > ^ > (irb):1: Illegal octal digit > t = Time.local(2007,09,09,00,00) > ^ > > I don't get the error when I specify the following date. It doesn't > seem > to like the month of September. (-; If you put a 0 in front of a number you are specifying an octal number instead of a decimal number. Octal is base 8, so there is no such thing as an octal number including a digit greater than 7: t = Time.local 2007, 011, 011, 00, 00 Instead just use base 10: Time.local 2007, 9, 9, 0, 0