224件ヒット
[201-224件を表示]
(0.027秒)
別のキーワード
ライブラリ
- ビルトイン (224)
検索結果
-
Time
# gmtime -> self (15.0) -
タイムゾーンを協定世界時に設定します。
...のメソッドを呼び出した後は時刻変換を協定世界時として行ないます。
Time#localtime, Time#gmtime の挙動はシステムの
localtime(3) の挙動に依存します。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 t.gmtime # => 2000-01-01 11:15:01 UTC
p t.... -
Time
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (14.0) -
パターンマッチに使用する名前と値の Hash を返します。
...ッチに使用する名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。
//emlist[例][ruby]{
t = Time.utc(2022, 10, 5, 21, 25, 30)
if t in wday: 3, day: ..7 # deconstruct_keys が使われます
puts "first Wednesday of the month"
end
#=> "fir......ng 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
# getgm -> Time (14.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?...