るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.017秒)
トップページ > バージョン:2.6.0[x] > クエリ:Hash[x] > クラス:DateTime[x]

別のキーワード

  1. _builtin hash
  2. hash []
  3. dbm to_hash
  4. matrix hash
  5. _builtin to_hash

ライブラリ

キーワード

検索結果

DateTime.json_create(hash) -> DateTime (325.0)

JSON のオブジェクトから Ruby のオブジェクトを生成して返します。

JSON のオブジェクトから Ruby のオブジェクトを生成して返します。

@param hash 適切なキーを持つハッシュを指定します。

DateTime._strptime(str, format = '%FT%T%z') -> Hash (307.0)

与えられた雛型で日時表現を解析し、その情報に基づいてハッシュを生成します。

...す文字列
@param format 書式

例:

require 'date'
DateTime
._strptime('2001-02-03T12:13:14Z')
# => {:year=>2001, :mon=>2, :mday=>3, :hour=>12, :min=>13, :sec=>14, :zone=>"Z", :offset=>0}

DateTime
.strptime の内部で使用されています。

@see Date._strptime, DateTime.strptime...

DateTime#to_json(*args) -> String (58.0)

自身を JSON 形式の文字列に変換して返します。

...まま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。

//emlist[例][ruby]{
require "json/add/core"

DateTime
.now.to_json
# => "{\"json_class\":\"DateTime\",\"y\":2018,\"m\":12,\"d\":10,\"H\":1,\"M\":28,\"S\":57,\"of\":\"3/8\",\"sg\":2299161.0}"
//}

@see JSON::Generator::Gene...