675件ヒット
[201-300件を表示]
(0.172秒)
ライブラリ
- ビルトイン (663)
-
json
/ add / time (12)
キーワード
- + (12)
- <=> (12)
- asctime (12)
- ceil (6)
- ctime (12)
- day (12)
-
deconstruct
_ keys (2) - dst? (12)
- eql? (12)
- floor (6)
- friday? (12)
- getgm (12)
- getlocal (24)
- getutc (12)
- gmt? (12)
-
gmt
_ offset (12) - gmtime (12)
- gmtoff (12)
- hour (12)
- inspect (6)
- isdst (12)
- localtime (24)
- mday (12)
- min (12)
- mon (12)
- monday? (12)
- month (12)
- nsec (12)
- round (12)
- saturday? (12)
- sec (12)
- strftime (12)
- subsec (12)
- succ (7)
- sunday? (12)
- thursday? (12)
-
to
_ a (12) -
to
_ f (12) -
to
_ i (12) -
to
_ json (12) -
to
_ r (12) -
to
_ s (12) - tuesday? (12)
-
tv
_ nsec (12) -
tv
_ sec (12) -
tv
_ usec (12) - usec (12)
- utc (12)
- utc? (12)
-
utc
_ offset (12) - wday (12)
- wednesday? (12)
- yday (12)
- year (12)
- zone (12)
検索結果
先頭5件
-
Time
# getutc -> Time (6256.0) -
タイムゾーンを協定世界時に設定した Time オブジェクトを新しく 生成して返します。
...に設定した Time オブジェクトを新しく
生成して返します。
//emlist[][ruby]{
p t = Time.local(2000,1,1,20,15,1) #=> 2000-01-01 20:15:01 +0900
p t.gmt? #=> false
p y = t.getgm #=> 2000-01-01 11:15:01 UTC
p y.gmt?......#=> true
p t == y #=> true
//}... -
Time
# to _ i -> Integer (6250.0) -
起算時からの経過秒数を整数で返します。
...起算時からの経過秒数を整数で返します。
//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 # => 946749845
p t.tv_sec # => 946749845
//}... -
Time
# tv _ sec -> Integer (6250.0) -
起算時からの経過秒数を整数で返します。
...起算時からの経過秒数を整数で返します。
//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 # => 946749845
p t.tv_sec # => 946749845
//}... -
Time
# to _ f -> Float (6244.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 # => 946749845
//}... -
Time
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (6238.0) -
パターンマッチに使用する名前と値の Hash を返します。
...month
* :day
* :yday
* :wday
* :hour
* :min
* :sec
* :subsec
* :dst
* :zone
@param array_of_names_or_nil パターンマッチに使用する名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。
//emlist[例][ruby]{
t = Time.utc(2......if t in wday: 3, day: ..7 # deconstruct_keys が使われます
puts "first Wednesday of the month"
end
#=> "first Wednesday of the month" が出力される
case t
in year: ...2022
puts "too old"
in month: ..9
puts "quarter 1-3"
in wday: 1..5, month:
puts "working day in month #{month}"......end
#=> "working day in month 10" が出力される
# クラスのチェックと組み合わせて利用することもできます
if t in Time(wday: 3, day: ..7)
puts "first Wednesday of the month"
end
//}
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Time
# month -> Integer (6238.0) -
月を整数で返します。
...月を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.month # => 1
p t.mon # => 1
//}... -
Time
# to _ r -> Rational (6238.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 t.to_r # => (473374922500003/500000)
//}... -
Time
# saturday? -> bool (6232.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
//}... -
Time
# thursday? -> bool (6232.0) -
self の表す時刻が木曜日である場合に true を返します。 そうでない場合に false を返します。
...self の表す時刻が木曜日である場合に true を返します。
そうでない場合に false を返します。
//emlist[][ruby]{
t = Time.local(1995, 12, 21) # => 1995-12-21 00:00:00 +0900
p t.thursday? # => true
//}... -
Time
# tuesday? -> bool (6232.0) -
self の表す時刻が火曜日である場合に true を返します。 そうでない場合に false を返します。
...self の表す時刻が火曜日である場合に true を返します。
そうでない場合に false を返します。
//emlist[][ruby]{
t = Time.local(1991, 2, 19) # => 1991-02-19 00:00:00 +0900
p t.tuesday? # => true
//}...