るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. date today
  2. datetime today
  3. specification today
  4. rubygems/specification today
  5. today date

ライブラリ

検索結果

Date.today(start = Date::ITALY) -> Date (54325.0)

現在の日付に相当する日付オブジェクトを生成します。

...現在の日付に相当する日付オブジェクトを生成します。

@param start グレゴリオ暦をつかい始めた日をあらわすユリウス日

//emlist[例][ruby]{
require 'date'
Date
.today # => #<Date: 2017-09-20 ...>
//}...

Date#to_json(*args) -> String (22.0)

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

...args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。

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

Date
.today.to_json
# => "{\"json_class\":\"Date\",\"y\":2018,\"m\":12,\"d\":11,\"sg\":2299161.0}"
//}

@see JSON::Generator::GeneratorMethods::Hash#to_json...