Skip to content

Date#rfc3339Date#iso8601 の alias のようにドキュメンテーションされている #2904

@mktktmr

Description

@mktktmr

こんにちは。
Ruby のお世話になっている者です。
日々のメンテナンス感謝しております。

さて、掲題の Date#rfc3339 ですが、日本語のドキュメントを読むと Date#rfc3339Date#iso8601 の実態が同じメソッドであるように見え、誤解を招くように思いました。

参考に英語のドキュメントを載せておきます。
ご確認お願いいたします。

Japanse

https://docs.ruby-lang.org/ja/3.3/method/Date/i/iso8601.html

[[ISO:8601]] 書式の文字列を返します (拡大表記はつかいません)。

https://docs.ruby-lang.org/ja/3.3/method/Date/i/rfc3339.html

[[ISO:8601]] 書式の文字列を返します (拡大表記はつかいません)。

English

https://docs.ruby-lang.org/en/3.3/Date.html#method-i-iso8601

Equivalent to strftime with argument '%Y-%m-%d' (or its shorthand form '%F');

https://docs.ruby-lang.org/en/3.3/Date.html#method-i-rfc3339

Equivalent to strftime with argument '%FT%T%:z'; see Formats for Dates and Times:

動作確認

bash-3.2$ ruby -v
ruby 3.3.1 (2024-04-23 revision c56cd86388) [arm64-darwin22]
bash-3.2$ irb
irb(main):001> require 'date'
=> true
irb(main):002> Date.today.rfc3339
=> "2024-08-09T00:00:00+00:00"
irb(main):003> Date.today.iso8601
=> "2024-08-09"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions