# 08 DEC date error ? :)

**URL:** <https://www.ruby-forum.com/t/08-dec-date-error/120183>\
**Category:** Rails\
**Created:** [November 14, 2007, 4:33pm UTC](https://www.ruby-forum.com/t/08-dec-date-error/120183 "2007-11-14T16:33:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 14, 2007, 4:33pm UTC](https://www.ruby-forum.com/t/08-dec-date-error/120183/1 "2007-11-14T16:33:58Z")

</div>

look at this, in my xxx.lib I do:

EVENT\_DEADLINE = Date.new(2007,12,8)  
VIPC\_DEADLINE = Date.new(2007,11,01)  
WHO\_DEADLINE = Date.new(2007,10,24)  
VIPC\_DEADLINE\_TIME = Time.local(2007,11,01,23,59,59)

and everything works…

I can also write

EVENT\_DEADLINE = Date.new(2007,12,07)  
or  
EVENT\_DEADLINE = Date.new(2007,12,09)

but when I try

EVENT\_DEADLINE = Date.new(2007,12,08)

Rails raises a Status: 500!! 😮

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 14, 2007, 4:36pm UTC](https://www.ruby-forum.com/t/08-dec-date-error/120183/2 "2007-11-14T16:36:54Z")

</div>

On 14 Nov 2007, at 15:32, Emanuele Mek Tozzato wrote:

> EVENT\_DEADLINE = Date.new(2007,12,07)  
> or  
> EVENT\_DEADLINE = Date.new(2007,12,09)
> 
> but when I try
> 
> EVENT\_DEADLINE = Date.new(2007,12,08)

I wouldn’t expect 08 or 09 to work: a leading 0 denotes an octal  
number, and 08 isn’t a legal octal number

Fred

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 14, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/08-dec-date-error/120183/3 "2007-11-14T16:42:46Z")

</div>

tried the same in irb.

Date.new(2007,12,01) till Date.new(2007,12,07) work fine, returns a  
date object.

But Date.new(2007,12,08) & Date.new(2007,12,09) raises an exception  
‘Illegal octal digit’ - they are 08 & 09 i suppose.

Date.new(2007,12,8) & Date.new(2007,12,9) solves the problem.
