Project

General

Profile

Actions

Feature #735

closed

Date#inspect

Added by rubikitch (rubikitch .) about 16 years ago. Updated about 12 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-dev:37050]

Description

=begin
「inspectは人間に優しい文字列化」という観点から、Date#inspectの出力はふさわしくないと思います。
#<Date: 2008-11-10> やら #<DateTime 2008-11-10T05:22:03+09:00> のほうがわかりやすいです。

require 'date'
Date.today # => #<Date: 4909561/2,0,2299161>
Date.today.to_s # => "2008-11-10"
DateTime.now # => #<DateTime: 2120930221235025923/864000000000,3/8,2299161>
DateTime.now.to_s # => "2008-11-10T05:22:03+09:00"
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0