function CNDateString(date)
{
var cn = ["〇","一","이","삼","사","五","六","七","八","九"]
var s = [] ;
var YY = date.getFullYear().toString()
for (var i=0; iif (cn[YY.charAt(i) )])
s.push(cn[YY.charAt(i)])
else
s.push(YY.charAt(i))
s.push("연도" );
var MM = date.getMonth();
if (MMs.push(cn[MM])
else if (MM .push( "十" cn[MM% 10]);
s.push("월")
var DD = date.getDate()
if (DD<10)
s.push (cn[DD]);
else if (DD<20)
s.push("十" cn[DD% 10])
else
s.push(" Twenty" cn[DD% 10]);
s.push("日");
return s.join('');
}
예:
경고(CNDateString(new Date())) 가져오기: 2009년 7월 12일