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> |
|
|
|
