るりまサーチ

最速Rubyリファレンスマニュアル検索!
996件ヒット [901-996件を表示] (0.029秒)
トップページ > クラス:Time[x] > クエリ:time[x] > クエリ:-[x]

別のキーワード

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

ライブラリ

キーワード

検索結果

<< < ... 8 9 10 >>

Time#sec -> Integer (9113.0)

秒を整数で返します。

...秒を整数で返します。

//emlist[][ruby]{
p Time.mktime(2000, 1, 1).sec # => 0
//}

通常は0から59を返しますが、うるう秒の場合は60を返します。

//emlist[][ruby]{
ENV['TZ'] = 'right/UTC'
p Time.mktime(2005, 12, 31, 23, 59, 60).sec # => 60
//}...

Time#to_json(*args) -> String (9113.0)

自身を JSON 形式の文字列に変換して返します。

...す。

@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。

//emlist[例][ruby]{
require "json/add/core"

Time
.now.to_json # => "{\"json_class\":\"Time\",\"s\":1544968675,\"n\":676167000}"
//}

@see JSON::Generator::GeneratorMethods::Hash#to_json...

Time#tv_nsec -> Integer (9113.0)

時刻のナノ秒の部分を整数で返します。

...部分を整数で返します。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p "%10.9f" % t.to_f # => "946749845.000005960"
p t.nsec # => 6000
//}

IEEE 754 浮動小数点数で表現できる精度が違うため、Time#to_fの最小
の桁とnsecの最小の桁は異なり...

Time#subsec -> Integer | Rational (9107.0)

時刻を表す分数を返します。

...時刻を表す分数を返します。

Rational を返す場合があります。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p "%10.9f" % t.to_f # => "946749845.000005960"
p t.subsec #=> (3/500000)
//}

to_f の値と subsec の値の下のほうの桁の値は異なる場...

Time#tv_usec -> Integer (9107.0)

時刻のマイクロ秒の部分を整数で返します。

...時刻のマイクロ秒の部分を整数で返します。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p "%10.6f" % t.to_f #=> "946749845.000006"
p t.usec #=> 6
//}...

絞り込み条件を変える

Time#usec -> Integer (9107.0)

時刻のマイクロ秒の部分を整数で返します。

...時刻のマイクロ秒の部分を整数で返します。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p "%10.6f" % t.to_f #=> "946749845.000006"
p t.usec #=> 6
//}...

Time#zone -> String (9107.0)

タイムゾーンを表す文字列を返します。

...タイムゾーンを表す文字列を返します。

//emlist[][ruby]{
p Time.now.zone # => "JST"
//}...

Time#hash -> Integer (9101.0)

self のハッシュ値を返します。

self のハッシュ値を返します。

@return ハッシュ値を返します。


@see Object#hash

Time#to_date -> Date (9101.0)

対応する Date オブジェクトを返します。

対応する Date オブジェクトを返します。
<< < ... 8 9 10 >>