るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

クラス

キーワード

検索結果

Time#httpdate -> String (21313.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-31T12...
...:34:56+09:00'
t = Time.iso8601(iso8601_time)
p t.httpdate #=> "Sun, 31 Aug 2008 03:34:56 GMT"...

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

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

... ruby で定義されていない(つまりネイティブ
である)場合は 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/rub...
...y/2.4.0/time.rb", 654]
//}

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

Time.parse(date, now = Time.now) -> Time (9330.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 n...
...ArgumentError が発生します。

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

require
'time'

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

Time.parse(date, now = Time.now) {|year| year } -> Time (9330.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 n...
...ArgumentError が発生します。

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

require
'time'

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

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

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

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

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

require
'time'
r
es['last-modified'] = Time.now.httpdate

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

絞り込み条件を変える