240件ヒット
[1-100件を表示]
(0.036秒)
クラス
- File (12)
-
File
:: Stat (48) - Integer (12)
-
Process
:: Tms (48) - Random (36)
- Time (72)
- UnboundMethod (12)
検索結果
先頭5件
-
Time
# strftime(format) -> String (15377.0) -
時刻を format 文字列に従って文字列に変換した結果を返します。
...時刻を format 文字列に従って文字列に変換した結果を返します。
@param format フォーマット文字列を指定します。使用できるものは 以下の通りです。
* %A: 曜日の名称(Sunday, Monday ... )
* %a: 曜日の省略名(Sun, Mon ... )
* %B: 月......または午後(am,pm)
* %p: 午前または午後(AM,PM)
* %Q: 1970-01-01 00:00:00 UTC からの経過ミリ秒 (Time#strftime は対応していませんが、Date#strftime で使えます)
* %R: 24時間制の時刻。%H:%M と同等。
* %r: 12時間制の時刻。%I:%M:%S %p と同等......むUTCからのオフセット (例 +09:00:00)
* %%: %自身
* %+: date(1)の形式 (%a %b %e %H:%M:%S %Z %Y) (Time#strftime は対応していませんが、Date#strftime で使えます)
このメソッドは strftime(3) や glibcの仕様を参考に作成されており、以下のオプシ... -
File
:: Stat # atime -> Time (15310.0) -
最終アクセス時刻を返します。
...最終アクセス時刻を返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.atime.to_a #=> [45, 5, 21, 5, 9, 2007, 3, 248, false, "\223\214\213\236 (\225W\217\200\216\236) "]
//}
@see Time... -
Time
# saturday? -> bool (15109.0) -
self の表す時刻が土曜日である場合に true を返します。 そうでない場合に false を返します。
...self の表す時刻が土曜日である場合に true を返します。
そうでない場合に false を返します。
//emlist[][ruby]{
t = Time.local(2006, 6, 10) # => 2006-06-10 00:00:00 +0900
p t.saturday? # => true
//}... -
File
# atime -> Time (12320.0) -
最終アクセス時刻を Time オブジェクトとして返します。
...最終アクセス時刻を Time オブジェクトとして返します。
@raise IOError 自身が close されている場合に発生します。
@raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。
//emlist[例:][ruby]{
IO.write("testfile", "test")
Fil......e.open("testfile") { |f| f.atime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#ctime, File#mtime......e.open("testfile") { |f| f.atime } # => 2017-12-21 22:58:17 +0900
//}
@see File#lstat, File#ctime, File#mtime, File#birthtime... -
Time
# -(time) -> Float (9240.0) -
自身と time との時刻の差を Float で返します。単位は秒です。
...自身と time との時刻の差を Float で返します。単位は秒です。
@param time 自身との差を算出したい Time オブジェクトを指定します。
//emlist[][ruby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 2592000 # => 2000-01-31 00:00:00 +... -
File
:: Stat # ctime -> Time (9210.0) -
最終状態変更時刻を返します。 (状態の変更とは chmod などによるもので、Unix では i-node の変更を意味します)
...最終状態変更時刻を返します。
(状態の変更とは chmod などによるもので、Unix では i-node の変更を意味します)
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.ctime.to_f #=> 1188719843.0
//}
@see Time... -
File
:: Stat # mtime -> Time (9210.0) -
最終更新時刻を返します。
...最終更新時刻を返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.mtime #=> Wed Sep 05 20:42:18 +0900 2007
//}
@see Time... -
File
:: Stat # birthtime -> Time (9204.0) -
作成された時刻を返します。
...birthtime のない環境で発生します。
//emlist[][ruby]{
File.write("testfile", "foo")
sleep 10
File.write("testfile", "bar")
sleep 10
File.chmod(0644, "testfile")
sleep 10
File.read("testfile")
File.stat("testfile").birthtime #=> 2014-02-24 11:19:17 +0900
File.stat("testfile").mtime......#=> 2014-02-24 11:19:27 +0900
File.stat("testfile").ctime #=> 2014-02-24 11:19:37 +0900
File.stat("testfile").atime #=> 2014-02-24 11:19:47 +0900
//}... -
Time
# subsec -> Integer | Rational (9109.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 の値の下のほうの桁の値は異なる場...