るりまサーチ

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

別のキーワード

  1. net/imap param
  2. win32ole win32ole_param
  3. win32ole_param output?
  4. win32ole_param retval?
  5. bodytypetext param

ライブラリ

クラス

キーワード

検索結果

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

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

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

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

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

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

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

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

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

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

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

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

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

@param date 2616で定義されているHTTP-dateとしてパースされる文字列を指定します。

@raise ArgumentError dateが2616に準拠して...
...

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 compl...

Date._httpdate(str) -> Hash (6129.0)

このメソッドは Date.httpdate と似ていますが、日付オブジェクトを生成せずに、 見いだした要素をハッシュで返します。

...このメソッドは Date.httpdate と似ていますが、日付オブジェクトを生成せずに、
見いだした要素をハッシュで返します。

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

@param str 日付をあらわす文字列...

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

...0 +0900

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

@param date Time オブジェクトに変換可能な文字列を指定します。
@param now 現在時刻をTime オブジェクトで指定します。
デフォルトはTime.now...
...ドのフェイルセーフとして
以下のように使用できます:

require 'time'

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

従って Time.parse の失敗はチェックすべきです。...

絞り込み条件を変える

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

...0 +0900

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

@param date Time オブジェクトに変換可能な文字列を指定します。
@param now 現在時刻をTime オブジェクトで指定します。
デフォルトはTime.now...
...ドのフェイルセーフとして
以下のように使用できます:

require 'time'

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

従って Time.parse の失敗はチェックすべきです。...

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

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

...ます。

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

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

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

@see WEBrick...