48件ヒット
[1-48件を表示]
(0.032秒)
別のキーワード
検索結果
先頭4件
-
Time
. rfc2822(date) -> Time (18144.0) -
2822で定義されているdate-timeとしてdateをパースして Timeオブジェクトに変換します。 この形式は822で定義されて1123で更新された形式と 同じです。
...発生します。
使用例
require 'time'
rfc2822_time = 'Sun, 31 Aug 2008 12:08:19 +0900'
t = Time.rfc2822(rfc2822_time)
p t.kind_of?(Time) #=> true
non_rfc2822_time = 'Sun 31 Aug 2008 12:08:19 +0900'
begin
p Time.rfc2822(non_rfc2822_time)
rescue ArgumentError => err... -
Time
. rfc822(date) -> Time (3044.0) -
2822で定義されているdate-timeとしてdateをパースして Timeオブジェクトに変換します。 この形式は822で定義されて1123で更新された形式と 同じです。
...発生します。
使用例
require 'time'
rfc2822_time = 'Sun, 31 Aug 2008 12:08:19 +0900'
t = Time.rfc2822(rfc2822_time)
p t.kind_of?(Time) #=> true
non_rfc2822_time = 'Sun 31 Aug 2008 12:08:19 +0900'
begin
p Time.rfc2822(non_rfc2822_time)
rescue ArgumentError => err... -
Time
. parse(date , now = Time . now) -> Time (31.0) -
...ックによって変換されます。
require 'time'
Time.parse(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}
与えられた時刻に上位の要素がなかったり壊れていた場合、nowの
該当要素が使われます。
require 'time'
time = Time.local(2019, 5, 1)......お、1.9.2より前は例外は発生せず、現在時刻を表す
Time のインスタンスを返していました。
require 'time'
# 現在時刻が "Thu Nov 29 14:33:20 GMT 2001" で
# タイムゾーンがGMTとすると:
Time.parse("16:30") #=> Thu Nov 29......ます。
このメソッドは他のパース用メソッドのフェイルセーフとして
以下のように使用できます:
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(date , now = Time . now) {|year| year } -> Time (31.0) -
...ックによって変換されます。
require 'time'
Time.parse(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}
与えられた時刻に上位の要素がなかったり壊れていた場合、nowの
該当要素が使われます。
require 'time'
time = Time.local(2019, 5, 1)......お、1.9.2より前は例外は発生せず、現在時刻を表す
Time のインスタンスを返していました。
require 'time'
# 現在時刻が "Thu Nov 29 14:33:20 GMT 2001" で
# タイムゾーンがGMTとすると:
Time.parse("16:30") #=> Thu Nov 29......ます。
このメソッドは他のパース用メソッドのフェイルセーフとして
以下のように使用できます:
require 'time'
Time.rfc2822(date) rescue Time.parse(date)
Time.httpdate(date) rescue Time.parse(date)
Time.xmlschema(date) rescue Time.parse(date)
従っ...