Whoops - it was the DD.MM.YY thing. Change this part:

datAry = otplata.split('.');
yr = datAry[2] + 2000; // full year
mn = datAry[1] - 1; // month in 0-11 format