<?xml version="1.0" encoding="UTF-8"?>
<article>
  <body>Ruby&#12391;&#12399;&#12289;Date&#12398;&#12452;&#12531;&#12473;&#12479;&#12531;&#12473;&#12434;inspect&#12377;&#12427;&#12392;&#12289;&#20197;&#19979;&#12398;&#12424;&#12358;&#12394;&#39348;&#26579;&#12415;&#12398;&#12394;&#12356;&#25968;&#20516;&#12364;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;

ruby&gt;&gt;
Date.today.inspect
=&gt; &quot;#&lt;Date: 4909185/2,0,2299161&gt;&quot;
&lt;&lt;--

&#12371;&#12428;&#12399;Date&#12463;&#12521;&#12473;&#12364;&#26085;&#20184;&#12398;&#20869;&#37096;&#34920;&#29694;&#12392;&#12375;&#12390;Rational&#12434;&#21033;&#29992;&#12375;&#12390;&#12356;&#12427;&#12383;&#12417;&#12391;&#12377;&#12364;&#12289;inspect&#12375;&#12383;&#12392;&#12365;&#12395;&#12371;&#12398;&#34920;&#29694;&#12364;&#20986;&#12390;&#12365;&#12390;&#12418;&#12289;&#26085;&#20184;&#12364;&#12431;&#12363;&#12425;&#12394;&#12356;&#12398;&#12391;&#22256;&#12426;&#12414;&#12377;&#12397;&#12290;
&#12381;&#12371;&#12391;&#12289;&#20197;&#19979;&#12398;&#12424;&#12358;&#12395;Date#inspect&#12434;&#23450;&#32681;&#12375;&#12390;&#12354;&#12370;&#12427;&#12392;&#12289;
&#20154;&#38291;&#12395;&#20778;&#12375;&#12356;&#34920;&#29694;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;

ruby&gt;&gt;
class Date
  def inspect
    strftime '#&lt;Date: %x&gt;'
  end
end

&gt;&gt; Date.today
=&gt; #&lt;Date: 05/06/08&gt;
&lt;&lt;--

&#12371;&#12428;&#12394;&#12425;Date&#12364;&#20309;&#26085;&#12394;&#12398;&#12363;&#12431;&#12363;&#12426;&#12420;&#12377;&#12356;&#12391;&#12377;&#12397;&#12290;

`strftime`&#12398;`%x`&#12399;&#12525;&#12465;&#12540;&#12523;&#12395;&#12424;&#12387;&#12390;&#20986;&#21147;&#12364;&#22793;&#12431;&#12427;&#12398;&#12391;&#12289;
&#12362;&#20351;&#12356;&#12398;PC&#12398;&#29872;&#22659;&#12395;&#12424;&#12387;&#12390;&#12399;&#12289;&#19978;&#35352;&#12398;&#12424;&#12358;&#12394;&#20986;&#21147;&#12395;&#12394;&#12425;&#12394;&#12356;&#20107;&#12418;&#12354;&#12426;&#12414;&#12377;&#12290;

**See Also**

 * [[ruby]Date#inspect&#12364;&#12431;&#12363;&#12426;&#12395;&#12367;&#12356;&#12398;&#12289;&#12393;&#12540;&#12395;&#12363;&#12394;&#12425;&#12435;&#12398;&#12363;](http://d.hatena.ne.jp/rubikitch/20080512/1210585339)</body>
  <cached-tag-list>ruby tips</cached-tag-list>
  <comments-count type="integer">0</comments-count>
  <created-at type="datetime">2008-05-06T11:44:17+00:00</created-at>
  <daily-archive-id type="integer">571</daily-archive-id>
  <filter-type>blue_stole</filter-type>
  <id type="integer">562</id>
  <monthly-archive-id type="integer">56</monthly-archive-id>
  <pdf-digest nil="true"></pdf-digest>
  <permalink>/articles/562</permalink>
  <published-at type="datetime">2008-05-06T11:38:00+00:00</published-at>
  <secret>6408836c-8e2e-44f9-ba66-53bbe2273c4b</secret>
  <title>Date#inspect&#12434;&#12431;&#12363;&#12426;&#12420;&#12377;&#12367;&#12377;&#12427;</title>
  <updated-at type="datetime">2008-05-13T17:44:29+00:00</updated-at>
  <user-id type="integer">1</user-id>
</article>
