Back to feed
Renewal·서른의 생활코딩

Sample source 3) Basic JavaScript document structure ( Date object _ applied )

NS
normalstory
cover image


This time

there's a problem that may look easy at first,
but as soon as you actually try to write the program, you get stuck.

It's the day of the week.
In Korean..
The day of the week..
How do we do it?

They say in English or as numbers, you can have it auto-printed along with the date and time.
What to do, though 
for me too, the program I made or am going to make...( yet. lol whether that'll be true going forward, who knows lol ^^)
is supposed to be in Korean. 

In this case, using an array makes it easy to solve.




<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">




<head>


<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />




<title> Date object 2</title>






<script type="text/javascript">


//<!CDATA[




// Print the day of the week




var days = new Array("일","월","화","수","목","금","토");


var today = new Date();




document.write("오늘은"+today.getFullYear()+"년"+(today.getMonth()+1)+"월"+today.getDate()+"일"+days[today.getDay()]+"요일입니다.");




//]]]]]]>


</script>




</head>






<body>




</body>




</html>




This English version was translated by Claude.

친절한 찰쓰씨
Written by
친절한 찰쓰씨

Pleasant Charles — UI/UX researcher at AIT. Keeping notes on design, planning, and slow days here since 2010.

More on the author's page

Keep reading

Renewal

Steadily, for the long haul, without burning out

Mar 31, 2026·9 min
Renewal

Tech-life balance

Feb 7, 2026·3 min
Renewal

Humanality, by Park Jeong-ryeol

Feb 7, 2026·11 min