るりまサーチ

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

別のキーワード

  1. time httpdate
  2. time rfc2822
  3. time iso8601
  4. time parse
  5. time strptime

種類

ライブラリ

クラス

キーワード

検索結果

Time.parse(date, now = Time.now) -> Time (35528.0)

...date を Date._parse によって
パースして Timeオブジェクトに変換します。

ブロック付きで呼ばれた場合、dateの年はブロックによって変換されます。

require 'time'
Time
.parse(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}

与えられ...
...当要素が使われます。

require 'time'
time
= Time.local(2019, 5, 1)
Time
.parse("12:00", time) #=> 2019-05-01 12:00:00 +0900

下位の要素がなかったり壊れていた場合、最小値(1か0)が使われます。

@param date Time オブジェクトに変換可能な文字列...
...ドのフェイルセーフとして
以下のように使用できます:

require 'time'

Time
.rfc2822(date) rescue Time.parse(date)
Time
.httpdate(date) rescue Time.parse(date)
Time
.xmlschema(date) rescue Time.parse(date)

従って Time.parse の失敗はチェックすべきです。...

Time.parse(date, now = Time.now) {|year| year } -> Time (35528.0)

...date を Date._parse によって
パースして Timeオブジェクトに変換します。

ブロック付きで呼ばれた場合、dateの年はブロックによって変換されます。

require 'time'
Time
.parse(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}

与えられ...
...当要素が使われます。

require 'time'
time
= Time.local(2019, 5, 1)
Time
.parse("12:00", time) #=> 2019-05-01 12:00:00 +0900

下位の要素がなかったり壊れていた場合、最小値(1か0)が使われます。

@param date Time オブジェクトに変換可能な文字列...
...ドのフェイルセーフとして
以下のように使用できます:

require 'time'

Time
.rfc2822(date) rescue Time.parse(date)
Time
.httpdate(date) rescue Time.parse(date)
Time
.xmlschema(date) rescue Time.parse(date)

従って Time.parse の失敗はチェックすべきです。...

Time (6084.0)

時刻を表すクラスです。

...時刻を表すクラスです。

Time
.now は現在の時刻を返します。
File.mtime などが返すファイルのタイムスタンプは Time
オブジェクトです。

Time
オブジェクトは時刻を起算時からの経過秒数で保持しています。
起算時は協定世界...
...ます。

//emlist[][ruby]{
p Marshal.load(Marshal.dump(Time.now.gmtime)).zone
# => "UTC"
//}

time
ライブラリによって、Time.parse, Time.rfc2822, Time.httpdate, Time.iso8601 等が拡張されます。

Ruby 1.9.2 以降の Time クラスのデザインの詳細は
https://staff.aist.go.j...
...009.pdf や
「APIデザインケーススタディ」(https://gihyo.jp/book/2016/978-4-7741-7802-8)
の第4章を参照してください。

localtime(3) も参照してください。

=== C 言語との違いに注意

C 言語の tm 構造体とは異なり、month は 1 月に対
して 1 を...

NEWS for Ruby 2.2.0 (66.0)

NEWS for Ruby 2.2.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...* Float
* 追加: Float#next_float
* 追加: Float#prev_float

* File
* 追加: File.birthtime
* 追加: File#birthtime

* File::Stat
* 追加: File::Stat#birthtime

* GC
* GC.latest_gc_info は現在のGCのステータスを再現するために :state を返す...
...h_strongly_connected_component_from はブロックを省略すると Enumerator を返すようになりました。

* xmlrpc
* LibXMLStreamParser という新しいパーサーを追加しました

=== 標準添付ライブラリの互換性 (機能追加とバグ修正を除く)

* math...
...* time
* Time.parse, Time.strptime, Time.rfc2822, Time.xmlschema may produce
fixed-offset Time objects.
It is happen when usual localtime doesn't preserve the offset from UTC.
* Time.httpdate は常にUTCのTimeオブジェクトを生成します。
* Time.strptime...