るりまサーチ

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

別のキーワード

  1. _builtin name
  2. resolv each_name
  3. openssl name
  4. net/imap name
  5. win32ole name

ライブラリ

キーワード

検索結果

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

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

...n
* :sec
* :subsec
* :dst
* :zone

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

//emlist[例][ruby]{
t = Time.utc(2022, 10, 5, 21, 25, 30)

if t in wday: 3, day: ..7 #...
...ng 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#httpdate -> String (8.0)

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

...列を返します。
//emlist{
day-of-week, DD month-name CCYY hh:mm:ss GMT
//}
注意: 結果はいつも UTC (GMT) です。

使用例
require 'time'

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

Time#rfc2822 -> String (8.0)

2822 で定義されている date-time として表現される形式の文字列を 返します。

...されている date-time として表現される形式の文字列を
返します。

@return 以下の形式の文字列を返します。
//emlist{
day-of-week, DD month-name CCYY hh:mm:ss zone
//}
ただし zone は [+-]hhmm です。
self が UTC time の場合、zone は +0...
...000 になります。

使用例
require 'time'

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

Time#rfc822 -> String (8.0)

2822 で定義されている date-time として表現される形式の文字列を 返します。

...されている date-time として表現される形式の文字列を
返します。

@return 以下の形式の文字列を返します。
//emlist{
day-of-week, DD month-name CCYY hh:mm:ss zone
//}
ただし zone は [+-]hhmm です。
self が UTC time の場合、zone は +0...
...000 になります。

使用例
require 'time'

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