るりまサーチ

最速Rubyリファレンスマニュアル検索!
182件ヒット [1-100件を表示] (0.206秒)

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix det_e
  4. matrix rank_e
  5. open3 capture2e

ライブラリ

キーワード

検索結果

<< 1 2 > >>

DateTime#new_offset(offset = 0) -> DateTime (9102.0)

self を複製して、その時差を設定しなおします。 引数を省略した場合は、零 (協定世界時) になります。

...self を複製して、その時差を設定しなおします。
引数を省略した場合は、零 (協定世界時) になります。

DateTime
.new も参照してください。

@param offset 時差...

DateTime#offset -> Rational (9102.0)

時差を返します。

時差を返します。

DateTime#deconstruct_keys(array_of_names_or_nil) -> Hash (6102.0)

パターンマッチに使用する名前と値の Hash を返します。

...

* :year
* :month
* :day
* :yday
* :wday
* :hour
* :min
* :sec
* :sec_fraction
* :zone

@param array_of_names_or_nil パターンマッチに使用する名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。

//emlist[例][ruby...
...]{
dt = DateTime.new(2022, 10, 5, 13, 30)

if dt in wday: 1..5, hour: 10..18 # deconstruct_keys が使われます
puts "Working time"
e
nd
#=> "Working time" が出力される

case dt
in year: ...2022
puts "too old"
in month: ..9
puts "quarter 1-3"
in wday: 1..5, month:
puts "working day i...
...}"
e
nd
#=> "working day in month 10" が出力される

# クラスのチェックと組み合わせて利用することもできます
if dt in DateTime(wday: 1..5, hour: 10..18, day: ..7)
puts "Working time, first week of the month"
e
nd
//}

@see d:spec/pattern_matching#matching_non_primitive_...

DateTime#minute -> Integer (6102.0)

分を返します (0-59)。

分を返します (0-59)。

DateTime#sec -> Integer (6102.0)

秒を返します (0-59)。

秒を返します (0-59)。

絞り込み条件を変える

DateTime#sec_fraction -> Rational (6102.0)

秒の小数点以下の部分を表す分数を返します。

秒の小数点以下の部分を表す分数を返します。

DateTime#second -> Integer (6102.0)

秒を返します (0-59)。

秒を返します (0-59)。

DateTime#second_fraction -> Rational (6102.0)

秒の小数点以下の部分を表す分数を返します。

秒の小数点以下の部分を表す分数を返します。

DateTime#xmlschema(n = 0) -> String (6102.0)

8601 書式の文字列を返します (XML Schema の dateTime 相当)。 省略可能な引数により、印字する秒の小数点以下の桁数を与えることができます。

...返します (XML Schema の dateTime 相当)。
省略可能な引数により、印字する秒の小数点以下の桁数を与えることができます。

strftime('%FT%T%:z') と等価です。

@param n 小数点以下の桁数

例:

require 'date'
DateTime
.parse('2001-02-03T04:05:06.1...

DateTime#zone -> String (6102.0)

タイムゾーンを返します。

タイムゾーンを返します。

これは、正確には時差をあらわす文字列です。

絞り込み条件を変える

<< 1 2 > >>