aboutsummaryrefslogtreecommitdiff
path: root/files/ar/web/javascript/reference/global_objects/date/now/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ar/web/javascript/reference/global_objects/date/now/index.html')
-rw-r--r--files/ar/web/javascript/reference/global_objects/date/now/index.html80
1 files changed, 80 insertions, 0 deletions
diff --git a/files/ar/web/javascript/reference/global_objects/date/now/index.html b/files/ar/web/javascript/reference/global_objects/date/now/index.html
new file mode 100644
index 0000000000..ff6379db60
--- /dev/null
+++ b/files/ar/web/javascript/reference/global_objects/date/now/index.html
@@ -0,0 +1,80 @@
+---
+title: Date.now() | دالة الوقت الآن
+slug: Web/JavaScript/Reference/Global_Objects/Date/now
+tags:
+ - Date
+ - التاريخ
+ - الوقت
+ - جافاسكربت
+ - دالة
+ - دليل
+ - طريقة بديلة
+ - مرجع
+translation_of: Web/JavaScript/Reference/Global_Objects/Date/now
+---
+<div>{{JSRef}}</div>
+
+<p>تقوم دالة  <strong><code>Date.now()</code></strong> بعرض عدد الثواني التي مضت منذ بداية احتساب الوقت بطريقة Timestamp وهو الأول من يناير عام 1970 الساعة الثانية عشر منتصف الليل تمامًا (First of January 1970 00:00:00)  بتوقيت UTC.</p>
+
+<h2 id="بنية_الجملة">بنية الجملة</h2>
+
+<pre class="syntaxbox"><code>var timeInMs = Date.now();</code></pre>
+
+<h3 id="القيمة_الراجعة">القيمة الراجعة</h3>
+
+<p>القيمة الراجعة من هذه الدالة ستكون عبارة عن رقم  {{jsxref("Number")}}، هذا الرقم يشير إلى عدد الثواني التي انقضت منذ بداية احتساب الوقت بطريقة TimeStamp بالأنظمة التي تستند إلى UNIX.</p>
+
+<h2 id="الوصف">الوصف</h2>
+
+<p>لإن دالة  <code>now()</code> تقوم بإرجاع قيمة ثابتة من الوقت {{jsxref("Date")}} فيجب عليك استخدامها بهذا الشكل   <code>Date.now()</code> .</p>
+
+<h2 id="طريقة_احتياطية_(Polyfill)">طريقة احتياطية (Polyfill)</h2>
+
+<p>تم اعتماد هذه الدالة  في  إصدار ECMA-262 5<sup>th</sup> المحركات التي لم يتم تحديثها لتدعم هذه الدالة يمكنها أن تحاكي دالة <code>Date.now()</code> عبر استخدام هذه الشيفرة البرمجية، هذه الشيفرة ستسمح للمتصفحات بأن تحاكي وظيفة هذه الدالة في حالة عدم دعمها لها :</p>
+
+<pre class="brush: js">if (!Date.now) { // إذا لم تكن الدالة موجودة
+ Date.now = function now() { // قم بإنشاء الدالة
+ return new Date().getTime(); // واربطها بالوقت الحالي
+ };
+}
+</pre>
+
+<h2 id="الخصائص">الخصائص</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">الخاصية</th>
+ <th scope="col">الحالة</th>
+ <th scope="col">تعليقات</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.9.4.4', 'Date.now')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td>Initial definition. Implemented in JavaScript 1.5.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-date.now', 'Date.now')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-date.now', 'Date.now')}}</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.now")}}</p>
+
+<h2 id="اقرأ_أيضًا">اقرأ أيضًا</h2>
+
+<ul>
+ <li>{{domxref("Performance.now()")}} — provides timestamps with sub-millisecond resolution for use in measuring web page performance</li>
+ <li>{{domxref("console.time()")}} / {{domxref("console.timeEnd()")}}</li>
+</ul>