るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. matrix i

ライブラリ

クラス

キーワード

検索結果

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

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

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

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

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

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

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

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

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

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

Time.httpdate(date) -> Time (27413.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#httpdate -> String (27307.0)

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

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

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

使用例
require 'time'

i
so8601_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"...

Date#httpdate -> String (27301.0)

2616 (1123) で定められた書式の文字列を返します。

2616 (1123) で定められた書式の文字列を返します。

絞り込み条件を変える

UnboundMethod#source_location -> [String, Integer] | nil (12206.0)

ソースコードのファイル名と行番号を配列で返します。

...nil を返します。

//emlist[例][ruby]{
require 'time'

Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/ruby/2.4.0/time.rb", 654]
//}

@see Proc#source_location, Method#source_location...

Time.parse(date, now = Time.now) {|year| year } -> Time (9506.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 (9306.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) (3206.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...