るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.038秒)
トップページ > クラス:Time[x] > クエリ:at[x] > クエリ:to_f[x] > バージョン:2.2.0[x]

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

検索結果

Time#to_f -> Float (54625.0)

起算時からの経過秒数を浮動小数点数で返します。1 秒に満たない経過も 表現されます。

...起算時からの経過秒数を浮動小数点数で返します。1 秒に満たない経過も
表現されます。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p t # => 2000-01-02 03:04:05 +0900
p "%10.6f" % t.to_f # => "946749845.000006"
p t.to_i # => 946...

Time#subsec -> Integer | Rational (340.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 の値の下のほうの桁の値は異なる場...