るりまサーチ

最速Rubyリファレンスマニュアル検索!
66件ヒット [1-66件を表示] (0.196秒)
トップページ > クエリ:I[x] > クエリ:A[x] > クエリ:param[x] > クエリ:httpdate[x]

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

ライブラリ

クラス

キーワード

検索結果

DateTime.httpdate(str = 'Mon, 01 Jan -4712 00:00:00 GMT', start = Date::ITALY) -> DateTime (30519.0)

2616 で定められた書式の日付を解析し、 その情報に基づいて日付オブジェクトを生成します。

...で定められた書式の日付を解析し、
その情報に基づいて日付オブジェクトを生成します。

Date._httpdate も参照してください。

@param str 日付をあらわす文字列
@param start グレゴリオ暦をつかい始めた日をあらわすユリウス日...

Date.httpdate(str = 'Mon, 01 Jan -4712 00:00:00 GMT', start = Date::ITALY) -> Date (27519.0)

2616 で定められた書式の日付を解析し、 その情報に基づいて日付オブジェクトを生成します。

...で定められた書式の日付を解析し、
その情報に基づいて日付オブジェクトを生成します。

Date._httpdate も参照してください。

@param str 日付をあらわす文字列
@param start グレゴリオ暦をつかい始めた日をあらわすユリウス日...

Time.httpdate(date) -> Time (27419.0)

2616で定義されているHTTP-dateとしてdateをパースして Timeオブジェクトに変換します。

...るHTTP-dateとしてdateをパースして
Timeオブジェクトに変換します。

dateが2616に準拠していない、または
Timeクラスが指定された日時を表現できないときにArgumentErrorが
発生します。

@param date 2616で定義されているHTTP-dateとして...
...ます。

@raise ArgumentError dateが2616に準拠していない、または Timeクラスが指定された日時を表現できないときに発生します。

require 'time'
rfc2616_time = 'Sun, 31 Aug 2008 12:34:56 GMT'

t = Time.httpdate(rfc2616_time)
p t.kind_of?(Time) #=> true...
...non_rfc2616_time = 'San, 31 Aug 2008 12:34:56 GMT'
begin
Time.httpdate(non_rfc2616_time)
rescue ArgumentError => err
puts err #=> not RFC 2616 compliant date: "San, 31 Aug 2008 12:34:56 GMT"
end...

Time.parse(date, now = Time.now) {|year| year } -> Time (9518.0)

...date を Date._parse によって
パースして Timeオブジェクトに変換します。

ブロック付きで呼ばれた場合、dateの年はブロックによって変換されます。

require 'time'
Time.parse(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}

与えられ...
...require 'time'
time = Time.local(2019, 5, 1)
Time.parse("12:00", time) #=> 2019-05-01 12:00:00 +0900

下位の要素がなかったり壊れていた場合、最小値(1か0)が使われます。

@param date Time オブジェクトに変換可能な文字列を指定します。
@param now...
...
A
rgumentError が発生します。

このメソッドは他のパース用メソッドのフェイルセーフとして
以下のように使用できます:

require 'time'

Time.rfc2822(date) rescue Time.parse(date)
Time.httpdate(date) rescue Time.parse(date)
Time.xmlschema(date) res...

Time.parse(date, now = Time.now) -> Time (9318.0)

...date を Date._parse によって
パースして Timeオブジェクトに変換します。

ブロック付きで呼ばれた場合、dateの年はブロックによって変換されます。

require 'time'
Time.parse(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}

与えられ...
...require 'time'
time = Time.local(2019, 5, 1)
Time.parse("12:00", time) #=> 2019-05-01 12:00:00 +0900

下位の要素がなかったり壊れていた場合、最小値(1か0)が使われます。

@param date Time オブジェクトに変換可能な文字列を指定します。
@param now...
...
A
rgumentError が発生します。

このメソッドは他のパース用メソッドのフェイルセーフとして
以下のように使用できます:

require 'time'

Time.rfc2822(date) rescue Time.parse(date)
Time.httpdate(date) rescue Time.parse(date)
Time.xmlschema(date) res...

絞り込み条件を変える

WEBrick::HTTPResponse#[]=(field, val) (3218.0)

レスポンスの該当するヘッダに val を設定します。

...val を設定します。

@param field ヘッダ名を文字列で指定します。大文字と小文字を区別しません。

@param val ヘッダの値を指定します。to_s メソッドによって文字列に変換されます。

require 'time'
res['last-modified'] = Time.now.httpda...
...te

@see WEBrick::HTTPResponse#chunked?, WEBrick::HTTPResponse#content_length,
WEBrick::HTTPResponse#content_type...