254件ヒット
[201-254件を表示]
(0.137秒)
ライブラリ
- date (242)
-
json
/ add / date (12)
検索結果
先頭5件
-
Date
# prev _ year(n = 1) -> Date (3244.0) -
n 年前を返します。
...します。
//emlist[例][ruby]{
require 'date'
Date.new(2001,2,3).prev_year #=> #<Date: 2000-02-03 ...>
Date.new(2008,2,29).prev_year #=> #<Date: 2007-02-28 ...>
Date.new(2008,2,29).prev_year(4) #=> #<Date: 2004-02-29 ...>
//}
Date#<< も参照してください。
@param n 年数... -
Date
# <=>(other) -> -1 | 0 | 1 | nil (3231.0) -
二つの日付を比較します。 同じ日付なら 0 を、self が other よりあとの日付なら 1 を、 その逆なら -1 を返します。
...ther よりあとの日付なら 1 を、
その逆なら -1 を返します。
other は日付オブジェクトか、
天文学的なユリウス日をあらわす数値を指定します。
そうでない場合、比較ができないので nil を返します。
//emlist[][ruby]{
require "dat......e"
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
//}
@param other... -
Date
# +(n) -> Date (3208.0) -
self から n 日後の日付オブジェクトを返します。 n は数値でなければなりません。
...self から n 日後の日付オブジェクトを返します。
n は数値でなければなりません。
@param n 日数
@raise TypeError n が数値でない場合に発生します。... -
Date
# ===(other) -> bool (3208.0) -
同じ日なら真を返します。
...同じ日なら真を返します。
@param other 日付オブジェクト... -
Date
# prev _ day(n = 1) -> Date (3208.0) -
n 日前を返します。
...n 日前を返します。
@param n 日数...