الفرق بين المراجعتين ل"Ruby/Time/dst-3F"
اذهب إلى التنقل
اذهب إلى البحث
(أنشأ الصفحة ب'<noinclude>{{DISPLAYTITLE: التابع <code>day</code> الخاص بالصنف <code>Time</code> في روبي}}</noinclude> تصنيف: Ruby تصنيف: R...') |
|||
سطر 1: | سطر 1: | ||
− | <noinclude>{{DISPLAYTITLE: التابع <code> | + | <noinclude>{{DISPLAYTITLE: التابع <code>dst?</code> الخاص بالصنف <code>Time</code> في روبي}}</noinclude> |
[[تصنيف: Ruby]] | [[تصنيف: Ruby]] | ||
[[تصنيف: Ruby Method]] | [[تصنيف: Ruby Method]] | ||
[[تصنيف: Ruby Time]] | [[تصنيف: Ruby Time]] | ||
− | + | يُعيد التابع <code>dst?</code> القيمة <code>true</code> إن وقع <code>time</code> أثناء التوقيت الصيفي <code>[[Ruby/Time|Time]]</code> في المنطقة الزمنية الخاصة به. | |
==البنية العامة== | ==البنية العامة== | ||
− | <syntaxhighlight lang="ruby"> | + | <syntaxhighlight lang="ruby">dst? → true or false</syntaxhighlight> |
==القيمة المُعادة== | ==القيمة المُعادة== | ||
==أمثلة== | ==أمثلة== | ||
− | مثال على استخدام التابع <code> | + | مثال على استخدام التابع <code>dst?</code>: |
− | <syntaxhighlight lang="ruby"> | + | <syntaxhighlight lang="ruby"># CST6CDT: |
− | + | Time.local(2000, 1, 1).zone #=> "CST" | |
− | + | Time.local(2000, 1, 1).isdst #=> false | |
+ | Time.local(2000, 1, 1).dst? #=> false | ||
+ | Time.local(2000, 7, 1).zone #=> "CDT" | ||
+ | Time.local(2000, 7, 1).isdst #=> true | ||
+ | Time.local(2000, 7, 1).dst? #=> true | ||
+ | # Asia/Tokyo: | ||
+ | Time.local(2000, 1, 1).zone #=> "JST" | ||
+ | Time.local(2000, 1, 1).isdst #=> false | ||
+ | Time.local(2000, 1, 1).dst? #=> false | ||
+ | Time.local(2000, 7, 1).zone #=> "JST" | ||
+ | Time.local(2000, 7, 1).isdst #=> false | ||
+ | Time.local(2000, 7, 1).dst? #=> false</syntaxhighlight> | ||
==انظر أيضا== | ==انظر أيضا== | ||
− | * التابع <code>[[Ruby/Time/ | + | * التابع <code>[[Ruby/Time/day|day]]</code>: يستخلص التابع <code>day</code> من [[Ruby/Time|التوقيت]] رقم اليوم من الشهر (1..n) لـ <code>time</code>. |
− | * التابع <code>[[Ruby/Time/ | + | * التابع <code>[[Ruby/Time/eql-3F|eql?]]</code>: يُعيد <code>true</code> إذا كان كل من <code>time</code> و <code>other_time</code> (انظر فقرة البنية العامة) [[Ruby/Time|توقيت]] <code>[[Ruby/Time|Time]]</code>، وكان لهما نفس عدد الثواني وكسور الثواني. |
==مصادر== | ==مصادر== | ||
− | *[http://ruby-doc.org/core-2.5.1/Time.html#method-i- | + | *[http://ruby-doc.org/core-2.5.1/Time.html#method-i-dst-3F قسم التابع dst? في الصنف Time في توثيق روبي الرسمي.] |
مراجعة 13:17، 7 نوفمبر 2018
يُعيد التابع dst?
القيمة true
إن وقع time
أثناء التوقيت الصيفي Time
في المنطقة الزمنية الخاصة به.
البنية العامة
dst? → true or false
القيمة المُعادة
أمثلة
مثال على استخدام التابع dst?
:
# CST6CDT:
Time.local(2000, 1, 1).zone #=> "CST"
Time.local(2000, 1, 1).isdst #=> false
Time.local(2000, 1, 1).dst? #=> false
Time.local(2000, 7, 1).zone #=> "CDT"
Time.local(2000, 7, 1).isdst #=> true
Time.local(2000, 7, 1).dst? #=> true
# Asia/Tokyo:
Time.local(2000, 1, 1).zone #=> "JST"
Time.local(2000, 1, 1).isdst #=> false
Time.local(2000, 1, 1).dst? #=> false
Time.local(2000, 7, 1).zone #=> "JST"
Time.local(2000, 7, 1).isdst #=> false
Time.local(2000, 7, 1).dst? #=> false
انظر أيضا
- التابع
day
: يستخلص التابعday
من التوقيت رقم اليوم من الشهر (1..n) لـtime
. - التابع
eql?
: يُعيدtrue
إذا كان كل منtime
وother_time
(انظر فقرة البنية العامة) توقيتTime
، وكان لهما نفس عدد الثواني وكسور الثواني.