영원한사랑

<script language="javascript">
    var inDay = "2006-04-03";
    var inSp = inDay.split("-");
    var newinD = new Date(inSp[0], inSp[1] - 1, inSp[2]);
    var inDTimeS = newinD.valueOf();

    var outDay = "2006-04-07";
    var outSp = outDay.split("-");
    var newoutD = new Date(outSp[0], outSp[1] - 1, outSp[2]);
    var outDTimeS = newoutD.valueOf();

    var dayCnt = (outDTimeS - inDTimeS)/(60*60*24*1000);

    var loopDate = new Array();

    for(i=0;i<=dayCnt;i++){
        var arrTimeS = inDTimeS + (i*60*60*24*1000);
        var arrDate = new Date(arrTimeS);
        var loopY = arrDate.getYear();
        var loopM = arrDate.getMonth()+1;
        var loopD = arrDate.getDate();

        if((""+loopM).length==1) loopM = "0"+loopM;
        if((""+loopD).length==1) loopD = "0"+loopD;
       
        loopDate[i] = loopY+"-"+loopM+"-"+loopD;
    }

    for(i=0;i<loopDate.length;i++){
        document.write(loopDate[i]+"<br>");
    }
</script>