794件ヒット
[1-100件を表示]
(0.092秒)
ライブラリ
- date (782)
-
json
/ add / date (12)
キーワード
- + (12)
- << (12)
- <=> (12)
- === (12)
- >> (12)
- ajd (12)
- amjd (12)
- asctime (12)
- ctime (12)
- cwday (12)
- cweek (12)
- cwyear (12)
- day (12)
-
deconstruct
_ keys (2) - downto (24)
- england (12)
- friday? (12)
- gregorian (12)
- gregorian? (12)
- httpdate (12)
- iso8601 (12)
- italy (12)
- jd (12)
- jisx0301 (12)
- julian (12)
- julian? (12)
- ld (12)
- leap? (12)
- mday (12)
- mjd (12)
- mon (12)
- monday? (12)
- month (12)
-
new
_ start (12) - next (12)
-
next
_ day (12) -
next
_ month (12) -
next
_ year (12) -
prev
_ day (12) -
prev
_ month (12) -
prev
_ year (12) - rfc2822 (12)
- rfc3339 (12)
- rfc822 (12)
- saturday? (12)
- start (12)
- step (24)
- strftime (12)
- succ (12)
- sunday? (12)
- thursday? (12)
-
to
_ date (12) -
to
_ datetime (12) -
to
_ json (12) -
to
_ s (12) -
to
_ time (12) - tuesday? (12)
- upto (24)
- wday (12)
- wednesday? (12)
- xmlschema (12)
- yday (12)
- year (12)
検索結果
先頭5件
-
Date
# -(x) -> Rational | Date (18103.0) -
x が日付オブジェクトなら、ふたつの差を Rational で返します。単位は日です。 あるいは x が数値ならば、self より x 日前の日付を返します。
x が日付オブジェクトなら、ふたつの差を Rational で返します。単位は日です。
あるいは
x が数値ならば、self より x 日前の日付を返します。
@param x 日数、あるいは日付オブジェクト
@raise TypeError x が数値でも日付オブジェクトでもない場合に発生します。 -
Date
# <<(n) -> Date (198.0) -
self より n ヶ月前の日付オブジェクトを返します。 n は数値でなければなりません。
...date'
Date.new(2001,2,3) << 1 #=> #<Date: 2001-01-03 ...>
Date.new(2001,2,3) << -2 #=> #<Date: 2001-04-03 ...>
//}
対応する月に同じ日が存在しない時は、代わりにその月の末日が使われます。
//emlist[][ruby]{
require 'date'
Date.new(2001,3,28) << 1 #=> #<Date......: 2001-02-28 ...>
Date.new(2001,3,31) << 1 #=> #<Date: 2001-02-28 ...>
//}
このことは以下のように、もしかすると予期しない振る舞いをするかもしれません。
//emlist[][ruby]{
require 'date'
Date.new(2001,3,31) << 2 #=> #<Date: 2001-01-31 ...>
Date.new(200......1,3,31) << 1 << 1 #=> #<Date: 2001-01-28 ...>
Date.new(2001,3,31) << 1 << -1 #=> #<Date: 2001-03-28 ...>
//}
Date#prev_month も参照してください。
@param n 月数... -
Date
# >>(n) -> Date (198.0) -
self から n ヶ月後の日付オブジェクトを返します。 n は数値でなければなりません。
...ruby]{
require 'date'
Date.new(2001,2,3) >> 1 #=> #<Date: 2001-03-03 ...>
Date.new(2001,2,3) >> -2 #=> #<Date: 2000-12-03 ...>
//}
対応する月に同じ日が存在しない時は、代わりにその月の末日が使われます。
//emlist[][ruby]{
require 'date'
Date.new(2001,1,28)......e: 2001-02-28 ...>
Date.new(2001,1,31) >> 1 #=> #<Date: 2001-02-28 ...>
//}
このことは以下のように、もしかすると予期しない振る舞いをするかもしれません。
//emlist[][ruby]{
require 'date'
Date.new(2001,1,31) >> 2 #=> #<Date: 2001-03-31 ...>
Date.new(20......01,1,31) >> 1 >> 1 #=> #<Date: 2001-03-28 ...>
Date.new(2001,1,31) >> 1 >> -1 #=> #<Date: 2001-01-28 ...>
//}
Date#next_month も参照してください。
@param n 月数... -
Date
# next _ year(n = 1) -> Date (138.0) -
n 年後を返します。
...相当します。
//emlist[例][ruby]{
require 'date'
Date.new(2001,2,3).next_year #=> #<Date: 2002-02-03 ...>
Date.new(2008,2,29).next_year #=> #<Date: 2009-02-28 ...>
Date.new(2008,2,29).next_year(4) #=> #<Date: 2012-02-29 ...>
//}
Date#>> も参照してください。
@param n 年... -
Date
# prev _ year(n = 1) -> Date (138.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 (125.0) -
二つの日付を比較します。 同じ日付なら 0 を、self が other よりあとの日付なら 1 を、 その逆なら -1 を返します。
...逆なら -1 を返します。
other は日付オブジェクトか、
天文学的なユリウス日をあらわす数値を指定します。
そうでない場合、比較ができないので nil を返します。
//emlist[][ruby]{
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
//}
@param other 日付オブジェクトまたは数値... -
Date
# cwday -> Integer (118.0) -
暦週の日 (曜日) を返します (1-7、月曜は1)。
...暦週の日 (曜日) を返します (1-7、月曜は1)。... -
Date
# cweek -> Integer (118.0) -
暦週を返します (1-53)。
...暦週を返します (1-53)。... -
Date
# day -> Integer (118.0) -
月の日を返します (1-31)。
...月の日を返します (1-31)。...