るりまサーチ

最速Rubyリファレンスマニュアル検索!
272件ヒット [1-100件を表示] (0.126秒)

別のキーワード

  1. bigdecimal/util to_d
  2. float to_d
  3. rsa d
  4. rsa d=
  5. matrix d

ライブラリ

キーワード

検索結果

<< 1 2 3 > >>

Time#to_date -> Date (6202.0)

対応する Date オブジェクトを返します。

...対応する Date オブジェクトを返します。...

Time#to_datetime -> DateTime (6202.0)

対応する DateTime オブジェクトを返します。

...対応する DateTime オブジェクトを返します。...

Time#deconstruct_keys(array_of_names_or_nil) -> Hash (6108.0)

パターンマッチに使用する名前と値の Hash を返します。

...nth
* :day
* :yday
* :wday
* :hour
* :min
* :sec
* :subsec
* :dst
* :zone

@param array_of_names_or_nil パターンマッチに使用する名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。

//emlist[例][ruby]{
t = Time.utc(202...
...in wday: 3, day: ..7 # deconstruct_keys が使われます
puts "first Wednesday of the month"
end
#=> "first Wednesday of the month" が出力される

case t
in 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 t in Time(wday: 3, day: ..7)
puts "first Wednesday of the month"
end
//}

@see d:spec/pattern_matching#matching_non_primitive_objects...

Time#day -> Integer (6102.0)

日を整数で返します。

...日を整数で返します。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.day # => 2
p t.mday # => 2
//}...

Time#dst? -> bool (6102.0)

自身が表す日時が夏時間なら true を返します。そうでないなら false を返します。

...自身が表す日時が夏時間なら true を返します。そうでないなら false を返します。

//emlist[][ruby]{
ENV['TZ'] = 'US/Pacific'
p Time.local(2000, 7, 1).isdst # => true
p Time.local(2000, 1, 1).isdst # => false
//}...

絞り込み条件を変える

Time#friday? -> bool (6102.0)

self の表す時刻が金曜日である場合に true を返します。 そうでない場合に false を返します。

...self の表す時刻が金曜日である場合に true を返します。
そうでない場合に false を返します。

//emlist[][ruby]{
t = Time.local(1987, 12, 18) # => 1987-12-18 00:00:00 +0900
p t.friday? # => true
//}...

Time#httpdate -> String (6102.0)

2616 で定義されている HTTP-date の rfc1123-date 形式の文字列を 返します。

...いる HTTP-date の rfc1123-date 形式の文字列を
返します。

@return 以下の形式の文字列を返します。
//emlist{
d
ay-of-week, DD month-name CCYY hh:mm:ss GMT
//}
注意: 結果はいつも UTC (GMT) です。

使用例
require 'time'

iso8601_time = '2008-08-31...
...T12:34:56+09:00'
t = Time.iso8601(iso8601_time)
p t.httpdate #=> "Sun, 31 Aug 2008 03:34:56 GMT"...

Time#isdst -> bool (6102.0)

自身が表す日時が夏時間なら true を返します。そうでないなら false を返します。

...自身が表す日時が夏時間なら true を返します。そうでないなら false を返します。

//emlist[][ruby]{
ENV['TZ'] = 'US/Pacific'
p Time.local(2000, 7, 1).isdst # => true
p Time.local(2000, 1, 1).isdst # => false
//}...

Time#mday -> Integer (6102.0)

日を整数で返します。

...日を整数で返します。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.day # => 2
p t.mday # => 2
//}...

Time#monday? -> bool (6102.0)

self の表す時刻が月曜日である場合に true を返します。 そうでない場合に false を返します。

...self の表す時刻が月曜日である場合に true を返します。
そうでない場合に false を返します。

//emlist[][ruby]{
t = Time.local(2003, 8, 4) # => 2003-08-04 00:00:00 +0900
p t.monday? # => true
//}...

絞り込み条件を変える

<< 1 2 3 > >>