Restoration
11/11/2016 - 11:39 AM

日付をフォーマット

日付をフォーマット

function dateText(year,month,day){
	if(year != ''){
		year = year + '年';
	}
	if(month != ''){
		month = month + '月';
	}
	if(day != ''){
		day = day + '日';
	}
	return year + month + day;
}
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDay();
document.write(dateText(year,month,day));