るりまサーチ

最速Rubyリファレンスマニュアル検索!
157件ヒット [1-100件を表示] (0.030秒)

別のキーワード

  1. time httpdate
  2. time rfc2822
  3. time iso8601
  4. time parse
  5. time strptime

ライブラリ

キーワード

検索結果

<< 1 2 > >>

Time.at(time) -> Time (27527.0)

time で指定した時刻の Time オブジェクトを返します。

...
time
で指定した時刻の Time オブジェクトを返します。

キーワード引数 in でタイムゾーンを指定できます。タイムゾーンの指定がなく
引数が数値の場合、生成された Time オブジェクトのタイムゾーンは地方時となります。...
...@param time Time オブジェクト、もしくは起算時からの経過秒数を表わす数値で指定します。
@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
"UTC" かミリタリータイムゾーンの文字列または
数値でタイムゾーンを...
...{
Time
.at(0) # => 1970-01-01 09:00:00 +0900
Time
.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time
.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time
.at(946702800) # => 2000-01-01 14:00:00 +0900
Time
.at(...

Time.at(time, in:) -> Time (27527.0)

time で指定した時刻の Time オブジェクトを返します。

...
time
で指定した時刻の Time オブジェクトを返します。

キーワード引数 in でタイムゾーンを指定できます。タイムゾーンの指定がなく
引数が数値の場合、生成された Time オブジェクトのタイムゾーンは地方時となります。...
...@param time Time オブジェクト、もしくは起算時からの経過秒数を表わす数値で指定します。
@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
"UTC" かミリタリータイムゾーンの文字列または
数値でタイムゾーンを...
...{
Time
.at(0) # => 1970-01-01 09:00:00 +0900
Time
.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time
.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time
.at(946702800) # => 2000-01-01 14:00:00 +0900
Time
.at(...

Time.at(time) -> Time (27503.0)

time で指定した時刻の Time オブジェクトを返します。

...
time
で指定した時刻の Time オブジェクトを返します。

キーワード引数 in でタイムゾーンを指定できます。タイムゾーンの指定がなく
引数が数値の場合、生成された Time オブジェクトのタイムゾーンは地方時となります。...
...@param time Time オブジェクト、もしくは起算時からの経過秒数を表わす数値で指定します。
@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
数値でタイムゾーンを指定します。

//emlist[][ruby]{
Time
.at(0)...
...0
Time
.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time
.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time
.at(946702800) # => 2000-01-01 14:00:00 +0900
Time
.at(-284061600) # => 1960-12-31 15:00:00 +0900
Time
.at(...

Time.at(time, in:) -> Time (27503.0)

time で指定した時刻の Time オブジェクトを返します。

...
time
で指定した時刻の Time オブジェクトを返します。

キーワード引数 in でタイムゾーンを指定できます。タイムゾーンの指定がなく
引数が数値の場合、生成された Time オブジェクトのタイムゾーンは地方時となります。...
...@param time Time オブジェクト、もしくは起算時からの経過秒数を表わす数値で指定します。
@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
数値でタイムゾーンを指定します。

//emlist[][ruby]{
Time
.at(0)...
...0
Time
.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time
.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time
.at(946702800) # => 2000-01-01 14:00:00 +0900
Time
.at(-284061600) # => 1960-12-31 15:00:00 +0900
Time
.at(...

Time.at(time) -> Time (27471.0)

time で指定した時刻の Time オブジェクトを返します。

...
time
で指定した時刻の Time オブジェクトを返します。

引数が数値の場合、生成された Time オブジェクトのタイムゾーンは地方時となります。

@param time Time オブジェクト、もしくは起算時からの経過秒数を表わす数値で指定...
...{
Time
.at(0) # => 1970-01-01 09:00:00 +0900
Time
.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time
.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time
.at(946702800) # => 2000-01-01 14:00:00 +0900
Time
.at(...
...-284061600) # => 1960-12-31 15:00:00 +0900
Time
.at(946684800.2).usec # => 200000
//}...

絞り込み条件を変える

Time.at(time, usec) -> Time (27412.0)

time + (usec/1000000) の時刻を表す Time オブジェクトを返します。 浮動小数点の精度では不十分な場合に使用します。

...
time
+ (usec/1000000) の時刻を表す Time オブジェクトを返します。
浮動小数点の精度では不十分な場合に使用します。

キーワード引数 in でタイムゾーンを指定できます。タイムゾーンの指定がない場合、
生成された Time オブ...
...のタイムゾーンは地方時となります。

@param time 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。

@param usec マイクロ秒をInteger、 Float、 Rational、または他のNumericで指定します。

@para...
...m in "+HH:MM" や "-HH:MM" のような形式の文字列か
"UTC" かミリタリータイムゾーンの文字列または
数値でタイムゾーンを指定します。

//emlist[][ruby]{
Time
.at(946684800, 123456.789).nsec # => 123456789
//}...

Time.at(time, usec, in:) -> Time (27412.0)

time + (usec/1000000) の時刻を表す Time オブジェクトを返します。 浮動小数点の精度では不十分な場合に使用します。

...
time
+ (usec/1000000) の時刻を表す Time オブジェクトを返します。
浮動小数点の精度では不十分な場合に使用します。

キーワード引数 in でタイムゾーンを指定できます。タイムゾーンの指定がない場合、
生成された Time オブ...
...のタイムゾーンは地方時となります。

@param time 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。

@param usec マイクロ秒をInteger、 Float、 Rational、または他のNumericで指定します。

@para...
...m in "+HH:MM" や "-HH:MM" のような形式の文字列か
"UTC" かミリタリータイムゾーンの文字列または
数値でタイムゾーンを指定します。

//emlist[][ruby]{
Time
.at(946684800, 123456.789).nsec # => 123456789
//}...

Time.at(time, usec) -> Time (27408.0)

time + (usec/1000000) の時刻を表す Time オブジェクトを返します。 浮動小数点の精度では不十分な場合に使用します。

...
time
+ (usec/1000000) の時刻を表す Time オブジェクトを返します。
浮動小数点の精度では不十分な場合に使用します。

キーワード引数 in でタイムゾーンを指定できます。タイムゾーンの指定がない場合、
生成された Time オブ...
...のタイムゾーンは地方時となります。

@param time 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。

@param usec マイクロ秒をInteger、 Float、 Rational、または他のNumericで指定します。

@para...
...m in "+HH:MM" や "-HH:MM" のような形式の文字列か
数値でタイムゾーンを指定します。

//emlist[][ruby]{
Time
.at(946684800, 123456.789).nsec # => 123456789
//}...

Time.at(time, usec, in:) -> Time (27408.0)

time + (usec/1000000) の時刻を表す Time オブジェクトを返します。 浮動小数点の精度では不十分な場合に使用します。

...
time
+ (usec/1000000) の時刻を表す Time オブジェクトを返します。
浮動小数点の精度では不十分な場合に使用します。

キーワード引数 in でタイムゾーンを指定できます。タイムゾーンの指定がない場合、
生成された Time オブ...
...のタイムゾーンは地方時となります。

@param time 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。

@param usec マイクロ秒をInteger、 Float、 Rational、または他のNumericで指定します。

@para...
...m in "+HH:MM" や "-HH:MM" のような形式の文字列か
数値でタイムゾーンを指定します。

//emlist[][ruby]{
Time
.at(946684800, 123456.789).nsec # => 123456789
//}...

Time.at(time, usec) -> Time (27396.0)

time + (usec/1000000) の時刻を表す Time オブジェクトを返します。 浮動小数点の精度では不十分な場合に使用します。

...
time
+ (usec/1000000) の時刻を表す Time オブジェクトを返します。
浮動小数点の精度では不十分な場合に使用します。

生成された Time オブジェクトのタイムゾーンは地方時となります。

@param time 起算時からの経過秒数を表わ...
...す値をInteger、 Float、 Rational、または他のNumericで指定します。

@param usec マイクロ秒をInteger、 Float、 Rational、または他のNumericで指定します。


//emlist[][ruby]{
Time
.at(946684800, 123456.789).nsec # => 123456789
//}...

絞り込み条件を変える

Time.at(seconds, xseconds, unit) -> Time (27317.0)

unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。

...unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。

@param seconds 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param xseconds unit に対応するミリ秒...
...ーンを指定します。

//emlist[][ruby]{
Time
.at(946684800, 123.456789, :millisecond).nsec # => 123456789
Time
.at(946684800, 123456.789, :usec).nsec # => 123456789
Time
.at(946684800, 123456.789, :microsecond).nsec # => 123456789
Time
.at(946684800, 123456789, :nsec).nsec # =>...

Time.at(seconds, xseconds, unit, in:) -> Time (27317.0)

unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。

...unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。

@param seconds 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param xseconds unit に対応するミリ秒...
...ーンを指定します。

//emlist[][ruby]{
Time
.at(946684800, 123.456789, :millisecond).nsec # => 123456789
Time
.at(946684800, 123456.789, :usec).nsec # => 123456789
Time
.at(946684800, 123456.789, :microsecond).nsec # => 123456789
Time
.at(946684800, 123456789, :nsec).nsec # =>...

Time.at(seconds, xseconds, unit) -> Time (27313.0)

unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。

...unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。

@param seconds 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param xseconds unit に対応するミリ秒...
...ーンを指定します。

//emlist[][ruby]{
Time
.at(946684800, 123.456789, :millisecond).nsec # => 123456789
Time
.at(946684800, 123456.789, :usec).nsec # => 123456789
Time
.at(946684800, 123456.789, :microsecond).nsec # => 123456789
Time
.at(946684800, 123456789, :nsec).nsec # =>...

Time.at(seconds, xseconds, unit, in:) -> Time (27313.0)

unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。

...unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。

@param seconds 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param xseconds unit に対応するミリ秒...
...ーンを指定します。

//emlist[][ruby]{
Time
.at(946684800, 123.456789, :millisecond).nsec # => 123456789
Time
.at(946684800, 123456.789, :usec).nsec # => 123456789
Time
.at(946684800, 123456.789, :microsecond).nsec # => 123456789
Time
.at(946684800, 123456789, :nsec).nsec # =>...

Time.at(seconds, xseconds, unit) -> Time (27301.0)

unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。

...unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。

@param seconds 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param xseconds unit に対応するミリ秒...
...れかを指定します。

//emlist[][ruby]{
Time
.at(946684800, 123.456789, :millisecond).nsec # => 123456789
Time
.at(946684800, 123456.789, :usec).nsec # => 123456789
Time
.at(946684800, 123456.789, :microsecond).nsec # => 123456789
Time
.at(946684800, 123456789, :nsec).nsec # =>...

絞り込み条件を変える

Time.strptime(date, format, now=self.now) -> Time (23450.0)

文字列を Date._strptime を用いて Time オブジェクト に変換します。

...ate._strptime を用いて Time オブジェクト
に変換します。

require 'time'
Time
.strptime('2001-02-03T04:05:06+09:00', '%Y-%m-%dT%H:%M:%S%z')
#=> 2001-02-03 06:05:06 +0900

ブロックを渡すと年の部分をブロックによって変換できます。
require 'time'
Time
...
....strptime('91/5/18 4:13:00', '%Y/%m/%d %T'){|y|
if y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
end
}
#=> 1991-05-18 04:13:00 +0900

Time
.strptime('01/5/18 4:13:00', '%Y/%m/%d %T'){|y|
if y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
e...
...nd
}
#=> 2001-05-18 04:13:00 +0900

詳しくは DateTime.strptime, Date.strptime を見てください。

@param date 時刻を表す文字列
@param format 書式文字列...

Time.strptime(date, format, now=self.now) {|y| ... } -> Time (23450.0)

文字列を Date._strptime を用いて Time オブジェクト に変換します。

...ate._strptime を用いて Time オブジェクト
に変換します。

require 'time'
Time
.strptime('2001-02-03T04:05:06+09:00', '%Y-%m-%dT%H:%M:%S%z')
#=> 2001-02-03 06:05:06 +0900

ブロックを渡すと年の部分をブロックによって変換できます。
require 'time'
Time
...
....strptime('91/5/18 4:13:00', '%Y/%m/%d %T'){|y|
if y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
end
}
#=> 1991-05-18 04:13:00 +0900

Time
.strptime('01/5/18 4:13:00', '%Y/%m/%d %T'){|y|
if y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
e...
...nd
}
#=> 2001-05-18 04:13:00 +0900

詳しくは DateTime.strptime, Date.strptime を見てください。

@param date 時刻を表す文字列
@param format 書式文字列...

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

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

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

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

@param date 2616で定義されているHTTP-dateとして...
...tError 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) -> Time (17456.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 現在時刻をTime オブジェクトで指定します。
デフォルトはTime.nowとなります。

@raise ArgumentError dateに空文字列を与えた場合、発生します。
なお、1.9.2より前は例外は発生せず...

Time.parse(date, now = Time.now) {|year| year } -> Time (17456.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 現在時刻をTime オブジェクトで指定します。
デフォルトはTime.nowとなります。

@raise ArgumentError dateに空文字列を与えた場合、発生します。
なお、1.9.2より前は例外は発生せず...

絞り込み条件を変える

<< 1 2 > >>