# Switch statement acting weird

**URL:** <https://forum.kirupa.com/t/switch-statement-acting-weird/152986>\
**Category:** Uncategorized\
**Created:** [June 28, 2005, 4:06pm UTC](https://forum.kirupa.com/t/switch-statement-acting-weird/152986 "2005-06-28T16:06:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mprzybylski](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mprzybylski/32/613_2.png) [@mprzybylski](https://forum.kirupa.com/u/mprzybylski)\
**Post date:** [June 28, 2005, 4:06pm UTC](https://forum.kirupa.com/t/switch-statement-acting-weird/152986/1 "2005-06-28T16:06:58Z")

</div>

i’m writing a switch statement for my date conversion from my RSS feed (yeah i figured it out myself, finally, lol). anyway, it works fine except it gives me a syntax error with Aug and Sep saying:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 28: Syntax error.  
return 08;

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 31: Syntax error.  
return 09;

Total ActionScript Errors: 2 Reported Errors: 2

and here is the code:

```auto
var node:XML = new XML("<pubDate>Sun, 26 Jun 2005 12:16:00 GMT</pubDate>");
var rfcDate:String = node.toString();
var dateArray:Array = rfcDate.split(" ");
function month():Number {
    switch (dateArray[2]) {
    case "Jan" :
        return 01;
        break;
    case "Feb" :
        return 02;
        break;
    case "Mar" :
        return 03;
        break;
    case "Apr" :
        return 04;
        break;
    case "May" :
        return 05;
        break;
    case "Jun" :
        return 06;
        break;
    case "Jul" :
        return 07;
        break;
    case "Aug" :
        return 08;
        break;
    case "Sep" :
        return 09;
        break;
    case "Oct" :
        return 10;
        break;
    case "Nov" :
        return 11;
        break;
    case "Dec" :
        return 12;
        break;
    default :
        trace("no date specified");
    }
}
trace(month());

```

if i take out the case for august and september, it works. whats wrong with the numbers 08 and 09? 8 and 9 itself dont work either???

CORRECTION: 8 and 9 does work, but why not 08 and 09 when all others work with the zero in front?
