aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/javascript/reference/global_objects/date/toisostring
diff options
context:
space:
mode:
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/date/toisostring')
-rw-r--r--files/ko/web/javascript/reference/global_objects/date/toisostring/index.html107
1 files changed, 107 insertions, 0 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/date/toisostring/index.html b/files/ko/web/javascript/reference/global_objects/date/toisostring/index.html
new file mode 100644
index 0000000000..a9743f04d6
--- /dev/null
+++ b/files/ko/web/javascript/reference/global_objects/date/toisostring/index.html
@@ -0,0 +1,107 @@
+---
+title: Date.prototype.toISOString()
+slug: Web/JavaScript/Reference/Global_Objects/Date/toISOString
+tags:
+ - Date
+ - JavaScript
+ - Method
+ - Prototype
+ - Reference
+ - polyfill
+translation_of: Web/JavaScript/Reference/Global_Objects/Date/toISOString
+---
+<div>{{JSRef}}</div>
+
+<p><strong><code>toISOString()</code></strong> 메서드는 단순화한 확장 ISO 형식(<a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a>)의 문자열을 반환합니다. 반환값은 언제나 24글자 또는 27글자(각각 <strong><code>YYYY-MM-DDTHH:mm:ss.sssZ</code></strong> 또는 <strong><code>±YYYYYY-MM-DDTHH:mm:ss.sssZ</code></strong>)입니다. 시간대는 언제나 UTC이며 접미어 "<code>Z</code>"로 표현합니다.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/date-toisostring.html")}}</div>
+
+
+
+<h2 id="구문">구문</h2>
+
+<pre class="syntaxbox"><code><var>dateObj</var>.toISOString()</code></pre>
+
+<h3 id="반환_값">반환 값</h3>
+
+<p>주어진 날짜를 국제표준시 기준 <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> 형식으로 표현한 문자열.</p>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="toISOString()_사용하기"><code>toISOString()</code> 사용하기</h3>
+
+<p>아래 예제는 비표준 문자열의 분석을 포함하고 있어 비 Mozilla 브라우저에서는 올바르게 작동하지 않을 수 있습니다.</p>
+
+<pre class="brush: js">const today = new Date('05 October 2011 14:48 UTC');
+
+console.log(today.toISOString()); // Returns 2011-10-05T14:48:00.000Z</pre>
+
+<h2 id="폴리필">폴리필</h2>
+
+<p><code>toISOString</code>은 ECMA-262 제5판에 표준으로 자리잡았습니다. 아직 지원하지 않는 환경에서는 다음 코드를 추가해 대체할 수 있습니다.</p>
+
+<pre class="brush: js">if (!Date.prototype.toISOString) {
+ (function() {
+
+ function pad(number) {
+ if (number &lt; 10) {
+ return '0' + number;
+ }
+ return number;
+ }
+
+ Date.prototype.toISOString = function() {
+ return this.getUTCFullYear() +
+ '-' + pad(this.getUTCMonth() + 1) +
+ '-' + pad(this.getUTCDate()) +
+ 'T' + pad(this.getUTCHours()) +
+ ':' + pad(this.getUTCMinutes()) +
+ ':' + pad(this.getUTCSeconds()) +
+ '.' + (this.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) +
+ 'Z';
+ };
+
+ }());
+}
+</pre>
+
+<h2 id="명세">명세</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.9.5.43', 'Date.prototype.toISOString')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.8.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-date.prototype.toisostring', 'Date.prototype.toISOString')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-date.prototype.toisostring', 'Date.prototype.toISOString')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+
+<p>{{Compat("javascript.builtins.Date.toISOString")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li>{{jsxref("Date.prototype.toLocaleDateString()")}}</li>
+ <li>{{jsxref("Date.prototype.toTimeString()")}}</li>
+ <li>{{jsxref("Date.prototype.toUTCString()")}}</li>
+</ul>