314件ヒット
[101-200件を表示]
(0.125秒)
ライブラリ
- date (314)
キーワード
- - (12)
- <=> (12)
- === (12)
- ajd (12)
- amjd (12)
-
deconstruct
_ keys (2) - downto (12)
- england (12)
- friday? (12)
- gregorian? (12)
- italy (12)
- julian (12)
- julian? (12)
- ld (12)
- leap? (12)
- monday? (12)
-
new
_ start (12) - saturday? (12)
- step (24)
- strftime (12)
- sunday? (12)
- thursday? (12)
- tuesday? (12)
- upto (12)
- wednesday? (12)
- xmlschema (12)
検索結果
先頭5件
-
Date
# <=>(other) -> -1 | 0 | 1 | nil (102.0) -
二つの日付を比較します。 同じ日付なら 0 を、self が other よりあとの日付なら 1 を、 その逆なら -1 を返します。
...を、self が other よりあとの日付なら 1 を、
その逆なら -1 を返します。
other は日付オブジェクトか、
天文学的なユリウス日をあらわす数値を指定します。
そうでない場合、比較ができないので nil を返します。
//emlist[][ru......by]{
require "date"
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 4) # => -1
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 3) # => 0
p Date.new(2001, 2, 3) <=> Date.new(2001, 2, 2) # => 1
p Date.new(2001, 2, 3) <=> Object.new # => nil
p Date.new(2001, 2, 3) <=> Rational(4903887, 2) # => 0
/... -
Date
# ===(other) -> bool (102.0) -
同じ日なら真を返します。
同じ日なら真を返します。
@param other 日付オブジェクト -
Date
# ajd -> Rational (102.0) -
このメソッドは Date#jd と似ていますが、天文学的なユリウス日を返します。 時刻を含みます。
...このメソッドは Date#jd と似ていますが、天文学的なユリウス日を返します。
時刻を含みます。... -
Date
# amjd -> Rational (102.0) -
このメソッドは Date#mjd と似ていますが、天文学的な修正ユリウス日を返します。 時刻を含みます。
...このメソッドは Date#mjd と似ていますが、天文学的な修正ユリウス日を返します。
時刻を含みます。... -
Date
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (102.0) -
パターンマッチに使用する名前と値の Hash を返します。
...:month
* :day
* :yday
* :wday
@param array_of_names_or_nil パターンマッチに使用する名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。
//emlist[例][ruby]{
d = Date.new(2022, 10, 5)
if d in wday: 3, day: ..7 # deconstruct_keys......year: ...2022
puts "too old"
in month: ..9
puts "quarter 1-3"
in wday: 1..5, month:
puts "working day in month #{month}"
end
#=> "working day in month 10" が出力される
# クラスのチェックと組み合わせて利用することもできます
if d in Date(wday: 3, day: ..7)
puts... -
Date
# downto(min) {|date| . . . } -> self (102.0) -
このメソッドは、step(min, -1){|date| ...} と等価です。
...このメソッドは、step(min, -1){|date| ...} と等価です。
@param min 日付オブジェクト
@see Date#step, Date#upto... -
Date
# friday? -> bool (102.0) -
金曜日なら真を返します。
金曜日なら真を返します。 -
Date
# gregorian? -> bool (102.0) -
グレゴリオ暦なら真を返します。
グレゴリオ暦なら真を返します。 -
Date
# monday? -> bool (102.0) -
月曜日なら真を返します。
月曜日なら真を返します。 -
Date
# new _ start(start = Date :: ITALY) -> Date (102.0) -
self を複製して、その改暦日を設定しなおします。 引数を省略した場合は、Date::ITALY (1582年10月15日) になります。
...self を複製して、その改暦日を設定しなおします。
引数を省略した場合は、Date::ITALY (1582年10月15日) になります。
Date.new も参照してください。
@param start グレゴリオ暦をつかい始めた日をあらわすユリウス日...