This time
let's build an object that represents the date
It keeps moving without rest,
and the developer or designer can't define it manually every time..
How can we display it?
|
|
<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 </title> |
|
|
|
|
|
<script type="text/javascript"> |
|
|
//<!CDATA[ |
|
|
|
|
|
yoil=new Date(); |
|
|
|
|
|
document.write(yoil.getFullYear()+"-year"); |
|
|
document.write(yoil.getMonth()+1+"-month"); // because it starts from 0. |
|
|
document.write(yoil.getDate()+"-day"); |
|
|
|
|
|
//]]]]]]> |
|
|
</script> |
|
|
|
|
|
</head> |
|
|
|
|
|
|
|
|
<body> |
|
|
|
|
|
</body> |
|
|
|
|
|
</html> |
|
|
|
