compiler warning for scope

I am gettign a "Unable to detect scope '_current' for the symbol 'day'."

for the following code !

      var _current = Gregorian.info(_time, Time.FORMAT_SHORT);
        if (lastdate != _current.day) {
            // day change
            //System.println("new day "+_current.day);
            lastdate = _current.day;
            dc.setPenWidth(3);

what does this mean ?

code seem to work in sim....