[인터돌™] 공부 해보자!! 열심히~~~

반응형

var today:Date = new Date();
today.setDate(today.getDate() - 14 );
var strMonth:String = "" + (today.getMonth() + 1);
var strDate:String = "" + today.getDate();
if(strMonth.length == 1) strMonth = "0" + strMonth;
if(strDate.length == 1) strDate = "0" + strDate;

trace (today.getFullYear() + strMonth + strDate);


14일전의 날짜를 계산하는 코드. 결과가 정확한지에 대해서 많이 확인은 못해봤지만 맞는 듯?




이 글을 공유합시다

facebook twitter googleplus kakaoTalk kakaostory naver band