aboutsummaryrefslogtreecommitdiff
path: root/files/id/web/javascript/reference/global_objects/date/getfullyear/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:17 -0500
commitda78a9e329e272dedb2400b79a3bdeebff387d47 (patch)
treee6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/id/web/javascript/reference/global_objects/date/getfullyear/index.html
parent1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff)
downloadtranslated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz
translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2
translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip
initial commit
Diffstat (limited to 'files/id/web/javascript/reference/global_objects/date/getfullyear/index.html')
-rw-r--r--files/id/web/javascript/reference/global_objects/date/getfullyear/index.html88
1 files changed, 88 insertions, 0 deletions
diff --git a/files/id/web/javascript/reference/global_objects/date/getfullyear/index.html b/files/id/web/javascript/reference/global_objects/date/getfullyear/index.html
new file mode 100644
index 0000000000..08e657aeec
--- /dev/null
+++ b/files/id/web/javascript/reference/global_objects/date/getfullyear/index.html
@@ -0,0 +1,88 @@
+---
+title: Date.prototype.getFullYear()
+slug: Web/JavaScript/Reference/Global_Objects/Date/getFullYear
+tags:
+ - Date
+ - JavaScript
+ - Metode
+ - Prototype
+ - Referensi
+translation_of: Web/JavaScript/Reference/Global_Objects/Date/getFullYear
+---
+<div>{{JSRef}}</div>
+
+<p>Metode <strong><code>getFullYear()</code></strong> mengembanlikan tahun dari tanggal yang dispesifikasi, mengikuti waktu lokal.</p>
+
+<p>Gunakan metode ini ketimbang metode {{jsxref("Date.prototype.getYear()", "getYear()")}}.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/date-getfullyear.html")}}</div>
+
+<p class="hidden">Sumber untuk contoh interaktif ini disimpan di repository GitHub. Jika kamu ingin berkontribusi ke project contoh interaktif ini, silakan clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> dan kirimi kamu pull request.</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox"><code><var>dateObj</var>.getFullYear()</code></pre>
+
+<h3 id="Nilai_kembali">Nilai kembali</h3>
+
+<p>Angka yang berkorespondensi ke tahuny dari tanggal yang diberikan, mengikuti waktu lokal.</p>
+
+<h2 id="Deskripsi">Deskripsi</h2>
+
+<p>Nilai yang dikembalikan oleh <code>getFullYear()</code> is an absolute number. For dates between the years 1000 and 9999, <code>getFullYear()</code> returns a four-digit number, for example, 1995. Use this function to make sure a year is compliant with years after 2000.</p>
+
+<h2 id="Contoh">Contoh</h2>
+
+<h3 id="Menggunakan_getFullYear()">Menggunakan <code>getFullYear()</code></h3>
+
+<p>Contoh ini menggassign nilai empat-digit dari tahun saat ini ke variabel <code>year</code>.</p>
+
+<pre class="brush: js">var today = new Date();
+var year = today.getFullYear();
+</pre>
+
+<h2 id="Spesifikasi">Spesifikasi</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Spesifikasi</th>
+ <th scope="col">Status</th>
+ <th scope="col">Komen</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>Definisi inisial. Diimplementasi di JavaScript 1.3.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.9.5.10', 'Date.prototype.getFullYear')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-date.prototype.getfullyear', 'Date.prototype.getFullYear')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-date.prototype.getfullyear', 'Date.prototype.getFullYear')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Kompatibilitas_peramban">Kompatibilitas peramban</h2>
+
+<p class="hidden">Tabel kompatibilitas di laman ini digenerate dari data terstruktur. Jika kamu ingin berkontribusi ke datanya, silakan check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> dan kirimi kami pull request.</p>
+
+<p>{{Compat("javascript.builtins.Date.getFullYear")}}</p>
+
+<h2 id="Lihat_juga">Lihat juga</h2>
+
+<ul>
+ <li>{{jsxref("Date.prototype.getUTCFullYear()")}}</li>
+ <li>{{jsxref("Date.prototype.setFullYear()")}}</li>
+ <li>{{jsxref("Date.prototype.getYear()")}}</li>
+</ul>