let date = new Date();
date = ds_in_y(date);
log(date[0] + " 年第 " + date[1] + " 天");
exit();

function ds_in_y(d) {
    d = [d];
    d.push(
        d[0].getFullYear(),
        d[0].getMonth(),
        d[0].getDate(),
        28
    );
    if (d[1] % 100 == 0) {
        if (d[1] % 400 == 0) {
            d[4]++;
        }
    } else if (d[1] % 4 == 0) {
        d[4]++;
    }
    d[0] = d.pop();
    switch (d[2]) {
        case 11:
            d[3] += 30;
        case 10:
            d[3] += 31;
        case 9:
            d[3] += 30;
        case 8:
            d[3] += 31;
        case 7:
            d[3] += 31;
        case 6:
            d[3] += 30;
        case 5:
            d[3] += 31;
        case 4:
            d[3] += 30;
        case 3:
            d[3] += 31;
        case 2:
            d[3] += d[0];
        case 1:
            d[3] += 31;
    }
    d = [d[1], d[3]];
    return d;
}
最后由 Zhan 0 编辑