[Feature #735] Date#inspect


#1

Feature #735: Date#inspect
http://redmine.ruby-lang.org/issues/show/735

e$B5/I<<Te(B: rubikitch .
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal

e$B!Ve(Binspecte$B$O?M4V$KM%$7$$J8;zNs2=!W$H$$$&4QE@$+$i!"e(BDate#inspecte$B$N=PNO$O$U$5$o$7$/$J$$$H;W$$$^$9!#e(B
#<Date: 2008-11-10> e$B$d$ie(B #<DateTime 2008-11-10T05:22:03+09:00>
e$B$N$[$&$,$o$+$j$d$9$$$G$9!#e(B

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”


#2

e$B!Ve(Binspecte$B$O?M4V$KM%$7$$J8;zNs2=!W$H$$$&4QE@$+$i!"e(BDate#inspecte$B$N=PNO$O$U$5$o$7$/$J$$$H;W$$$^$9!#e(B
#<Date: 2008-11-10> e$B$d$ie(B #<DateTime 2008-11-10T05:22:03+09:00> e$B$N$[$&$,$o$+$j$d$9$$$G$9!#e(B

e$B!Ve(Binspecte$B$O?M4V$KM%$7$$J8;zNs2=!W$H$$$&$N$O=i$a$FJ9$-$^$7$?!#8=>u$G$OK\e(B
e$B<AItJ,$,$9$Y$F8+$($F$$$k$N$G!"$=$l$J$j$K5$$KF~$C$F$$$^$9$,!“8=>u$N$h$&e(B
e$B$J>pJs$,BgItJ,$N?M4V$KL5MQ$G$”$k!"$H$$$&$3$H$J$i!"e(Binspect e$B$be(B
to_s e$B$HF1e(B
e$B$8$h$&$K$7$F$b$$$$$+$b$7$l$^$;$s!#e(B

e$B$?$@!"e(Binspect e$B$H$$$&$N$O!“e(Bsmalltalk
e$BM3Mh$8$c$J$$$+$H;W$&$N$G$9$,!”$=$Ne(B
e$B9M$($+$?$+$i$9$l$P!"8=>u$Ne(B inspect
e$B$O30$l$F$O$$$J$$$h$&$K;W$$$^$9!#%G%U%)e(B
e$B%k%H$Ne(B inspect e$B$N?6Iq$$$+$i$b$=$&46$8$^$9!#e(Bto_s
e$B$HKX$IJQ$i$J$$>pJs$rDse(B
e$B6!$9$k$3$H$K$O5?Ld$r46$8$^$9!#e(B

e$B$?$H$($P0J2<$N!“e(Ba e$B$He(B b
e$B$O0c$&$N$G$9$,!”$$$/$i$+IC0J2<$N7e$rI=<($9$k$3$He(B
e$B$K$7$F$b$=$N0c$$$OH=$i$J$$$+$b$7$l$^$;$s!#e(B

a = DateTime.parse(‘2008-11-10T01:02:03.123456789’)
b = DateTime.parse(‘2008-11-10T01:02:03.1234567891’)

e$B$^$?!“F1$8F|IU$N$h$&$K8+$($F$b!”%0%l%4%j%*Nq$H%f%j%&%9Nq$G$O0c$&$o$1$Ge(B
e$B$9$,!"$=$&$$$&$3$H$bH=$j$^$;$s!#8=>u$G$O!“0c$$$O$O$C$-$j$7$^$9!#e(B
inspect e$B$H$O$=$&$$$&$b$N$8$c$J$$$+$H$$$&5$$,$7$^$9!#e(Bto_s
e$B$7$?$iF1$8$h$&e(B
e$B$K8+$($?F|IU$b0c$&$b$N$@$C$?!”$H$$$&;v$,H=$l$P%G%P%C%0$KLrN)$D$H;W$$$^e(B
e$B$9!#e(B

e$B$3$3$G!V26$N9M$($ke(B
inspecte$B!W$r=R$Y9g$C$F$b$7$g$&$,$J$$$N$G!"$=$b$=$be(B
ruby e$B$Ne(B inspect
e$B$O$I$&$"$k$Y$-$@$C$?$N$+!"$^$D$b$H$5$s$K?V$$$F$+$i$I$&e(B
e$B$7$?$i$$$$$+9M$($?$[$&$,$$$$$G$7$g$&$+!#e(B


#3

Yukihiro M. wrote:

e$B$I$3$+$KBE6(E@$,$"$k$H$h$$$N$G$9$,!#$?$@!";d$Oe(Binspecte$B$,e(Bto_s
e$B$HF1MM$N!V?M4V$K$o$+$j$d$9$$F|IUe(B(DateTimee$B$N>l9g$O;~4V$be(B)e$B!W$Ne(B
e$BI=8=e(B e$B$be(B e$B4^$`$3$H$r4|BT$7$^$9!#e(B

e$B%G%P%C%0%b!<%I$N$H$-$@$1>:Y$J>pJs$rJV$9$H$$$&$N$O$I$&$G$7$g$&$+!#e(B

e$BNce(B:

% ruby1.9 -rdate -e ‘p Date.today’
2008-11-11

% ruby1.9 -rdate -e ‘p Date.today’ -d
#<Date: “2008-11-11”, @ajd=4909563/2, @of=0, @sg=2299161>

% ruby1.9 -rdate -e ‘p DateTime.now’
2008-11-11T06:24:32+09:00

% ruby1.9 -rdate -e ‘p DateTime.now’ -d
#<DateTime: “2008-11-11T06:24:32+09:00”,
@ajd=21209311227209169197/8640000000000, @of=3/8, @sg=2299161>

e$B%Q%C%Ae(B:

Index: lib/date.rb

— lib/date.rb (revision 20171)
+++ lib/date.rb (working copy)
@@ -1469,8 +1469,15 @@

Calculate a hash value for this date.

def hash() @ajd.hash end

  • Return internal object state as a programmer-readable string.

  • def inspect() format(’#<%s: %s,%s,%s>’, self.class, @ajd, @of, @sg)
    end
  • If +$DEBUG+ is true, returns internal object state as a

programmer-readable

  • string. Otherwise the same as +to_s+.

  • def inspect
  • if $DEBUG
  •  format('#<%s: %s @ajd=%s, @of=%s, @sg=%s, "%s">', to_s, 
    

self.class, @ajd, @of, @sg)

  • else

  •  to_s
    
  • end

  • end

    Return the date as a human-readable string.


#4

e$B$I$3$+$KBE6(E@$,$"$k$H$h$$$N$G$9$,!#$?$@!";d$Oe(Binspecte$B$,e(Bto_s
e$B$HF1MM$N!V?M4V$K$o$+$j$d$9$$F|IUe(B(DateTimee$B$N>l9g$O;~4V$be(B)e$B!W$Ne(B
e$BI=8=e(B e$B$be(B e$B4^$`$3$H$r4|BT$7$^$9!#e(B

e$BD9$$$G$9$1$I!"e(B

#<DateTime: 2008-11-11T00:00:00+00:00 (4909563/2,0,2299161)>

e$B$3$s$J$s$G$b$$$$$G$9$+!#e(B

e$BJL$b$N$H$7$Fe(B Object#examine e$B$H$+$Ge(B smalltalk e$B$Ne(B
inspect e$BAjEv$NL\E*$Ge(B

#<e$B%/%i%9L>e(B: to_s (e$B%$%s%9%?%s%9JQ?t$NFbMFe(B)>

e$B$N$h$&$JFbMF$rJV$9$b$N$,$"$l$P$=$N$[$&$,$$$$$N$+$b!#e(B


#5

From: Tadayoshi F. removed_email_address@domain.invalid
Subject: [ruby-dev:37059] Re: [Feature #735] Date#inspect
Date: Tue, 11 Nov 2008 06:59:30 +0900

e$B$I$3$+$KBE6(E@$,$"$k$H$h$$$N$G$9$,!#$?$@!";d$Oe(Binspecte$B$,e(Bto_s
e$B$HF1MM$N!V?M4V$K$o$+$j$d$9$$F|IUe(B(DateTimee$B$N>l9g$O;~4V$be(B)e$B!W$Ne(B
e$BI=8=e(B e$B$be(B e$B4^$`$3$H$r4|BT$7$^$9!#e(B

e$BD9$$$G$9$1$I!"e(B

#<DateTime: 2008-11-11T00:00:00+00:00 (4909563/2,0,2299161)>

e$B$3$s$J$s$G$b$$$$$G$9$+!#e(B

e$B$$$$$H;W$$$^$9!#e(B


#6

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:37056] Re: [Feature #735] Date#inspect”
on Mon, 10 Nov 2008 21:33:56 +0900, Tadayoshi F.
removed_email_address@domain.invalid writes:

|> e$B!Ve(Binspecte$B$O?M4V$KM%$7$$J8;zNs2=!W$H$$$&4QE@$+$i!“e(BDate#inspecte$B$N=PNO$O$U$5$o$7$/$J$$$H;W$$$^$9!#e(B
|> #<Date: 2008-11-10> e$B$d$ie(B #<DateTime 2008-11-10T05:22:03+09:00> e$B$N$[$&$,$o$+$j$d$9$$$G$9!#e(B
|
|e$B!Ve(Binspecte$B$O?M4V$KM%$7$$J8;zNs2=!W$H$$$&$N$O=i$a$FJ9$-$^$7$?!#8=>u$G$OK\e(B
|e$B<AItJ,$,$9$Y$F8+$($F$$$k$N$G!”$=$l$J$j$K5$$KF~$C$F$$$^$9$,!“8=>u$N$h$&e(B
|e$B$J>pJs$,BgItJ,$N?M4V$KL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B!W$r=R$Y9g$C$F$b$7$g$&$,$J$$$N$G!"$=$b$=$be(B
|ruby e$B$Ne(B inspect e$B$O$I$&$"$k$Y$-$@$C$?$N$+!"$^$D$b$H$5$s$K?V$$$F$+$i$I$&e(B
|e$B$7$?$i$$$$$+9M$($?$[$&$,$$$$$G$7$g$&$+!#e(B

e$B$I$3$+$KBE6(E@$,$"$k$H$h$$$N$G$9$,!#$?$@!";d$Oe(Binspecte$B$,e(Bto_s
e$B$HF1MM$N!V?M4V$K$o$+$j$d$9$$F|IUe(B(DateTimee$B$N>l9g$O;~4V$be(B)e$B!W$Ne(B
e$BI=8=e(B e$B$be(B e$B4^$`$3$H$r4|BT$7$^$9!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

#7

e$B1sF#$G$9!#e(B

2008/11/10 5:23 rubikitch . removed_email_address@domain.invalid:

e$B!Ve(Binspecte$B$O?M4V$KM%$7$$J8;zNs2=!W$H$$$&4QE@$+$i!"e(BDate#inspecte$B$N=PNO$O$U$5$o$7$/$J$$$H;W$$$^$9!#e(B
#<Date: 2008-11-10> e$B$d$ie(B #<DateTime 2008-11-10T05:22:03+09:00> e$B$N$[$&$,$o$+$j$d$9$$$G$9!#e(B

e$B:G=E$K$Oe(B yugui
e$B$5$s$NH=CG$K$h$j$^$9$,!"$3$l$O40A4$K;EMMJQ99$J$N$Ge(B
1.9 e$B7ONs$K$OF3F~$9$k$Y$-$G$J$$$H;W$$$^$9!#e(B
e$B$=$7$Fe(B yugui e$B$5$s$O$3$l$r5v2D$9$Y$-$G$J$$$H;d$O;W$$$^$9!#e(B

e$B$9$4$/NI$$Ds0F$@$H;W$&$N$G!“8D?ME*$K$b;DG0$G$O$”$j$^$9$,!D!D!#e(B

String#inspect e$B$re(B String#dump
e$B$N$h$&$K;H$&?M$,8:$i$J$$$H$$$&OC$be(B
e$B$"$k$N$G!"L@<(E*$Ke(B

  • e$BAH$9~$!&E:IU%i%$%V%i%jFb$Ne(B inspect
    e$B$O$9$Y$FL$Dj5A5sF0$G$"$ke(B
    • e$B%G%P%C%0;~$K$N$!V?M4V$K$h$$d$9$$J8;zNs2=!W$r9T$&$3$H$r4|BTe(B
      e$B$7$F$h$$e(B
    • e$B:G=E$K$=$N5sF0e(B (e$B$dLa$jCMe(B)
      e$B$K0MB8$7$?%3!<%I$r=q$$$F$O$J$i$J$$e(B

(e$B$=$b$=$bL$Dj5A5sF0$J$N$G8@$&$^$G$b$J$$$,!"5sF0$O>o$KJQ99$5$l$&$ke(B)

e$B$H$$$&;EMM$K$7$H$1$P$h$+$C$?$G$9$M$(!#e(B


#8

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:37059] Re: [Feature #735] Date#inspect”
on Tue, 11 Nov 2008 06:59:30 +0900, Tadayoshi F.
removed_email_address@domain.invalid writes:

|> e$B$I$3$+$KBE6(E@$,$"$k$H$h$$$N$G$9$,!#$?$@!";d$Oe(Binspecte$B$,e(Bto_s
|> e$B$HF1MM$N!V?M4V$K$o$+$j$d$9$$F|IUe(B(DateTimee$B$N>l9g$O;~4V$be(B)e$B!W$Ne(B
|> e$BI=8=e(B e$B$be(B e$B4^$`$3$H$r4|BT$7$^$9!#e(B
|
|e$BD9$$$G$9$1$I!"e(B
|
|#<DateTime: 2008-11-11T00:00:00+00:00 (4909563/2,0,2299161)>
|
|e$B$3$s$J$s$G$b$$$$$G$9$+!#e(B

e$B$$$$$s$8$c$J$$$G$7$g$&$+!#e(B

|e$BJL$b$N$H$7$Fe(B Object#examine e$B$H$+$Ge(B smalltalk e$B$Ne(B inspect e$BAjEv$NL\E*$Ge(B
|
|#<e$B%/%i%9L>e(B: to_s (e$B%$%s%9%?%s%9JQ?t$NFbMFe(B)>
|
|e$B$N$h$&$JFbMF$rJV$9$b$N$,$"$l$P$=$N$[$&$,$$$$$N$+$b!#e(B

e$B%$%s%9%?%s%9JQ?t$NFbMF$@$1$G$OH=JL$D$+$J$$$b$N$b$"$j$^$9$,!“e(B
e$BLr$KN)$D6ILL$b$”$k$G$7$g$&$M!#e(B


#9

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:37061] Re: [Feature #735] Date#inspect”
on Tue, 11 Nov 2008 12:21:13 +0900, “Yusuke ENDOH” removed_email_address@domain.invalid
writes:

|2008/11/10 5:23 rubikitch . removed_email_address@domain.invalid:
|> e$B!Ve(Binspecte$B$O?M4V$KM%$7$$J8;zNs2=!W$H$$$&4QE@$+$i!“e(BDate#inspecte$B$N=PNO$O$U$5$o$7$/$J$$$H;W$$$^$9!#e(B
|> #<Date: 2008-11-10> e$B$d$ie(B #<DateTime 2008-11-10T05:22:03+09:00> e$B$N$[$&$,$o$+$j$d$9$$$G$9!#e(B
|
|e$B:G=E$K$Oe(B yugui e$B$5$s$NH=CG$K$h$j$^$9$,!”$3$l$O40A4$K;EMMJQ99$J$N$Ge(B
|1.9 e$B7ONs$K$OF3F~$9$k$Y$-$G$J$$$H;W$$$^$9!#e(B
|e$B$=$7$Fe(B yugui e$B$5$s$O$3$l$r5v2D$9$Y$-$G$J$$$H;d$O;W$$$^$9!#e(B
|
|e$B$9$4$/NI$$Ds0F$@$H;W$&$N$G!“8D?ME*$K$b;DG0$G$O$”$j$^$9$,!D!D!#e(B

e$B:G=i$NJ}?KDL$j!“JQ99$Oe(Btrunke$B$K9T$o$l$k$Y$-$G$9!#$=$7$F$=$NJQ99e(B
e$B$re(B1.9.1e$B$K<h$j9~$`$+$I$&$+$NH=CG$Oe(BYuguie$B$5$se(B(e$B$@$1e(B)e$B$,9T$$$^$9!#e(B
Yuguie$B$5$s$,LB$o$l$?$J$i!”$3$3$KAjCL$5$l$k$3$H$b$"$k$G$7$g$&$,!#e(B

|String#inspect e$B$re(B String#dump e$B$N$h$&$K;H$&?M$,8:$i$J$$$H$$$&OC$be(B
|e$B$"$k$N$G!“L@<(E*$Ke(B
|
| - e$BAH$9~$!&E:IU%i%$%V%i%jFb$Ne(B inspect e$B$O$9$Y$FL$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O$b$H$b$H$=e(B
e$B$&8@$&;EMM$@$C$?$HG’<1$7$F$$$^$9!#$h$C$F!"$=$b$=$b=PNO7A<0$NJQ99$OHs8_49e(B
e$B$JJQ99$G$O$J$$$N$G$O$J$$$G$7$g$&$+!#e(BStringe$B$rJV$7$F$$$k8B$j!#e(B

e$B$J$*!"$3$N%9%l%C%I$rCN$i$:$K!V$3$l$O;EMMJQ99$G$O$J$$!W$H$$$&G’<1$Ge(B

e$B$&$C$+$je(BDate#inspecte$B$NJQ99$re(B1.9.1e$B$K<h$j9~$s$G$7$^$$$^$7$?!#e(B

e$B$7$P$i$/5DO@$N?d0$r8+$F!"I,MW$J$i$Pe(Br20209e$B$K$J$i$C$Fe(Breverte$B$7$h$&$H;W$$e(B

e$B$^$9!#e(B


#13

From: Yukihiro M. removed_email_address@domain.invalid
Subject: [ruby-dev:37057] Re: [Feature #735] Date#inspect
Date: Tue, 11 Nov 2008 00:56:59 +0900

|e$B!Ve(Binspecte$B$O?M4V$KM%$7$$J8;zNs2=!W$H$$$&$N$O=i$a$FJ9$-$^$7$?!#8=>u$G$OK\e(B

e$B$=$b$=$be(Binspecte$B$NL\E*$O%G%P%C%0=PNO$G$9$h$M!#e(Bpe$B$de(Birbe$B$N=PNO$G$b;H$o$l$F$$e(B
e$B$^$9$7!#?M4V$,FI$`$3$H$rL\E*$H$7$F$$$k0J>e!"?M4V$KM%$7$$!J$o$+$j$d$9$$!Ke(B
e$BJ8;zNs2=$H$$$&$N$O4V0c$C$F$$$J$$$H;W$$$^$9!#e(B

datee$B%i%$%V%i%j;HMQ<T$NN)>l$+$i!"e(BYYYY-MM-DDe$B7A<0$,4^$^$l$F$$$k$H4r$7$$$G$9!#e(B

e$B%0$K$O8=:_$NJ}$,$&$l$7$$$G$7$g$&$M!#e(B
e$B$*$C$7$c$kDL$j$G$9!#e(B

e$B$I$3$+$KBE6(E@$,$"$k$H$h$$$N$G$9$,!#$?$@!";d$Oe(Binspecte$B$,e(Bto_s
e$B$HF1MM$N!V?M4V$K$o$+$j$d$9$$F|IUe(B(DateTimee$B$N>l9g$O;~4V$be(B)e$B!W$Ne(B
e$BI=8=e(B e$B$be(B e$B4^$`$3$H$r4|BT$7$^$9!#e(B
^^

require ‘date’
today = Date.today # => #<Date: 4909563/2,0,2299161>
today.to_s # => “2008-11-11”

e$B$3$NNc$J$i$Pe(B
#<Date: 2008-11-11 4909563/2,0,2299161>
e$B$H$+$I$&$G$7$g$&$+!)e(B


#14

e$B1sF#$G$9!#e(B

2008/11/11 20:23 Tadayoshi F. removed_email_address@domain.invalid:

- e$B%G%P%C%0;~$K$N$_!V?M4V$K$h$_$d$9$$J8;zNs2=!W$r9T$&$3$H$r4|BTe(B
  e$B$7$F$h$$e(B
- e$B:G=*E*$K$=$N5sF0e(B (e$B$dLa$jCMe(B) e$B$K0MB8$7$?%3!<%I$r=q$$$F$O$J$i$J$$e(B
- (e$B$=$b$=$bL$Dj5A5sF0$J$N$G8@$&$^$G$b$J$$$,!"5sF0$O>o$KJQ99$5$l$&$ke(B)

e$B$H$$$&;EMM$K$7$H$1$P$h$+$C$?$G$9$M$(!#e(B

e$B$I$A$i$+$H$$$&$HKM$O$=$&$$$&$b$s$@$H;W$C$F$$$^$7$?!#e(B

e$B$=$&$$$&%3%s%;%s%5%9$,$"$k$N$O$=$&$@$H;W$&$s$G$9$,!"%3%s%;%s%5%9$He(B
e$B;EMM$O0c$&$H;W$$$^$7$?!#e(B

e$B$,!"e(BIRC e$B$GJ9$$$?$H$3$me(B yugui
e$B$5$s$N9M$($G$O!V$3$l$O%3%s%;%s%5%9$G$O$J$/e(B
e$B$b$H$b$H$=$&$$$&46$8$N;EMM$@$C$?!W$H$$$&$3$H$$?$$$J$N$G!"JQ99$7$F$$$$e(B
e$B$
$?$$$G$9!#e(B1.9.1 e$B$K$b<h$j9~$^$l$F$^$7$?!#e(B

e$B$J$N$G$I$&$d$i;d$NAa$H$A$j$N$h$&$G$9!#$4$a$s$J$5$$!#e(B