blob: 5e662855a50d00d4d71f2f3c6e94b89e99617a03 (
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.setTime()
slug: Web/JavaScript/Reference/Global_Objects/Date/setTime
translation_of: Web/JavaScript/Reference/Global_Objects/Date/setTime
browser-compat: javascript.builtins.Date.setTime
---
<div>{{JSRef}}</div>
<p>setTime () 메서드는 {{jsxref ( "Date")}} 객체를 1970 년 1 월 1 일 00:00:00 UTC부터 밀리 초 단위로 나타내는 시간으로 설정합니다.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox"><code><var>dateObj</var>.setTime(<var>timeValue</var>)</code></pre>
<h3 id="Parameters">Parameters</h3>
<dl>
<dt><code>timeValue</code></dt>
<dd>1970 년 1 월 1 일 00:00:00 UTC 이후의 밀리 초 수를 나타내는 정수입니다.</dd>
</dl>
<h3 id="Return_value">Return value</h3>
<p>1970 년 1 월 1 일 00:00:00 UTC와 업데이트 된 날짜 (사실상 인수의 값) 사이의 밀리 초 수입니다.</p>
<h2 id="Description">Description</h2>
<p>setTime () 메서드를 사용하면 다른 {{jsxref ( "Date")}} 객체에 날짜와 시간을 지정할 수 있습니다.</p>
<h2 id="Examples">Examples</h2>
<h3 id="Using_setTime()">Using <code>setTime()</code></h3>
<pre class="brush: js">var theBigDay = new Date('July 1, 1999');
var sameAsBigDay = new Date();
sameAsBigDay.setTime(theBigDay.getTime());
</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.getTime()")}}</li>
<li>{{jsxref("Date.prototype.setUTCHours()")}}</li>
</ul>
|