aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/global_objects/date/setdate/index.html
blob: e7b0acc55fb27fa2b907b216137aea44d14d6ab5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
title: Date.prototype.setDate()
slug: Web/JavaScript/Reference/Global_Objects/Date/setDate
translation_of: Web/JavaScript/Reference/Global_Objects/Date/setDate
browser-compat: javascript.builtins.Date.setDate
---
<div>{{JSRef}}</div>

<p><strong>setDate()</strong> 메서드는 현재 설정된 월의 시작 부분을 기준으로 {{jsxref ( "Date")}} 객체의 날짜를 설정합니다.</p>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox"><code><var>dateObj</var>.setDate(<var>dayValue</var>)</code></pre>

<h3 id="Parameters">Parameters</h3>

<dl>
 <dt><code>dayValue</code></dt>
 <dd>월의 일을 나타내는 정수입니다.</dd>
</dl>

<h3 id="Return_value">Return value</h3>

<p>1970 년 1 월 1 일 00:00:00 UTC와 주어진 날짜 사이의 밀리 초 ({{jsxref ( "Date")}} 개체도 변경됩니다).</p>

<h2 id="Description">Description</h2>

<p>dayValue가 해당 월의 날짜 값 범위를 벗어나면 setDate ()는 그에 따라 {{jsxref ( "Date")}} 객체를 업데이트합니다. 예를 들어, dayValue에 0이 제공되면 날짜는 이전 달의 마지막 날로 설정됩니다.</p>

<h2 id="Examples">Examples</h2>

<h3 id="Using_setDate()">Using <code>setDate()</code></h3>

<pre class="brush: js">var theBigDay = new Date(1962, 6, 7); // 1962-07-07
theBigDay.setDate(24);  // 1962-07-24
theBigDay.setDate(32);  // 1962-08-01
theBigDay.setDate(22);  // 1962-08-22</pre>

<h2 id="specifications">명세</h2>

<p>{{Specifications}}</p>

<h2 id="browser_compatibility">브라우저 호환성</h2>

<p>{{Compat}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{jsxref("Date.prototype.getDate()")}}</li>
 <li>{{jsxref("Date.prototype.setUTCDate()")}}</li>
</ul>