e$BBg86$G$9!#e(B
Ruby 1.8.6 e$B$+$ie(B Time#to_s e$B$N7A<0$,e(B
RFC 2822 e$B=`5r$KJQ99$K$J$k$h$&$J$N$G$9$,!"e(B
e$B$3$N7A<0$,4V0c$C$F$$$k$h$&$K;W$$$^$9!#e(B
From: “NARUSE, Yui” [email protected]
Subject: [ruby-dev:29467] Re: [ruby-cvs:17256] ruby, ruby: * time.c
(time_to_s): generate RFC822 style date string.
Message-ID: [email protected]
Date: Mon, 4 Sep 2006 18:33:50 +0900
e$B$K$J$C$F$$$^$9$,!"e(B
p Time.now, Time.now.utc
Mon, Sep 04 2006 18:12:44 +0900
Mon, Sep 04 2006 09:12:44 UT
e$B$,@5$7$$$+$H!#e(B
RFC 2822 e$B$Ne(B 3.3. Date and Time Specification e$B$K$h$k$H!"e(B
date = day month year
e$B$,@5$7$$$h$&$G$9!#e(B
OHARA Shigeki (e$BBg86e(B e$B=E<ye(B) [email protected]
At Mon, 5 Mar 2007 18:44:19 +0900,
OHARA Shigeki wrote:
Ruby 1.8.6 ã‹ã‚‰ Time#to_s ã®å½¢å¼ãŒ
RFC 2822 æº–æ‹ ã«å¤‰æ›´ã«ãªã‚‹ã‚ˆã†ãªã®ã§ã™ãŒã€
ã“ã®å½¢å¼ãŒé–“é•ã£ã¦ã„るよã†ã«æ€ã„ã¾ã™ã€‚
(snip)
RFC 2822 ã® 3.3. Date and Time Specification ã«ã‚ˆã‚‹ã¨ã€
date = day month year
ãŒæ£ã—ã„よã†ã§ã™ã€‚
 確ã‹ã«ãã®é€šã‚Šã§ã™ã。修æ£ã—ã¾ã™ã€‚
% /usr/local/bin/ruby -v -rtime -e ‘Time.rfc2822(Time.now.to_s)’
ruby 1.8.6 (2007-03-05 patchlevel 0) [i686-darwin8.8.3]
/usr/local/lib/ruby/1.8/time.rb:296:in `rfc2822’: not RFC 2822 compliant
date: “Mon, Mar 05 2007 19:25:08 +0900” (ArgumentError)
from -e:1
 ã¡ã‚‡ã£ã¨æƒ…ã‘ãªã„…。
–
/
/__ __ Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp
“Different eyes see different things,
Different hearts beat on different strings –
But there are times for you and me when all such things agree”
 ã¨ã“ã‚ã§ã€ 1.8.6 ã® Time#to_s ã‚’ RFC 2822 å½¢å¼ã«ã™ã‚‹ã¨ã„ã†ã®ã¯
最終決定ã§ã„ã„ã®ã§ã—ょã†ã‹ã€‚1.9 ã§ã¯ã¾ãŸé•ã†å½¢å¼ã«ãªã£ã¦ã„ã¾ã™ãŒã€
ã“ã‚Œã¯å¤‰æ›´ã—忘れã§ã™ã‚ˆã?
 1.9 ã§ã¾ãŸå¤‰ãˆã‚‹ãらã„ãªã‚‰ã€ 1.8.6 ã§å¤‰ãˆã‚‹ã®ã¯é¿ã‘ãŸã„ã®ã§ã™ãŒã€‚
–
/
/__ __ Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp
“Different eyes see different things,
Different hearts beat on different strings –
But there are times for you and me when all such things agree”
At Mon, 5 Mar 2007 23:27:33 +0900,
matz wrote:
Timezone表ç¾ã®éƒ¨åˆ†ã‚’数値表ç¾ã«ã™ã‚‹ã“ã¨ã ã‘ã ã£ãŸã®ã§ã™ãŒã€
Timezon表ç¾ã®ä½ç½®ã«ã¤ã„ã¦æ‚©ã‚“ã§ã„ã‚‹ã†ã¡ã«ãã®ã¾ã¾RFC2822å½¢å¼
ã«ãªã£ã¦ã—ã¾ã£ãŸã¨ã„ã†çµŒç·¯ãŒã‚ã‚Šã¾ã™(当åˆã€RFC2822ã¨ctimeå½¢
å¼ã®é•ã„ã‚’å分ã«èªè˜ã—ã¦ã„ãªã‹ã£ãŸ)。
 本当㫠RFC 2822 å½¢å¼ãŒæ¬²ã—ã„ãªã‚‰ãれ用ã®ãƒ¡ã‚½ãƒƒãƒ‰(time.rb ã®
Time#rfc2822 ãªã‚Šè‡ªä½œãƒ¡ã‚½ãƒƒãƒ‰ãªã‚Š)を使ã†ã¹ããªã®ã§ã€ to_s ãŒ
RFC 2822 å½¢å¼ã§ã‚ã‚‹å¿…è¦ã¯ãªã„ã§ã—ょã†ã。
 ãã‚Œã¯ã•ã¦ãŠã〠inspect 㯠usec ã‚’å«ã‚€å½¢å¼ã«å¤‰ãˆãŸæ–¹ãŒã„ã„ã‚“
ã˜ã‚ƒãªã„ã§ã—ょã†ã‹ã€‚(ctime ã‚„ RFC 2822 㯠usec ã‚’å«ã‚られãªã„)
ã§ã€Ruby 1.9ã§ã¯ISO8601å½¢å¼(ãŸã ã—区切りã®Tã¯ä½¿ã‚ãªã„)ã«ã—よ
ã†ã¨æ€ã£ã¦ã„ã¾ã™ã€‚元々1.8ã®ç¯„囲内ã§ã¯å°ã•ãªå¤‰æ›´ã«ã—ã¦ã€1.9ã®
ã¨ãã«å¤§ããªå¤‰æ›´ã«ã—よã†ã¨æ€ã£ã¦ã„ã¾ã—ãŸã‹ã‚‰ã€‚
 1.9 ã® rdoc ã¯å®Ÿè£…ã‚’åæ˜ ã—ã¦ã„ã¾ã›ã‚“。今ã®ä»•æ§˜ã¯ ISO 8601
ã§ã‚‚ YAML æº–æ‹ ã§ã‚‚ãªãä¸é€”åŠç«¯ãªã®ã§ã€ã“ã®æ©Ÿä¼šã«å®Ÿè£…も変ãˆã¦
ã—ã¾ã£ãŸæ–¹ãŒã„ã„ã¨æ€ã„ã¾ã™ãŒã€‚
Index: time.c
— time.c (revision 11998)
+++ time.c (working copy)
@@ -1185,11 +1185,14 @@
-
time.to_s => string
-
- Returns a string representing time. Equivalent to calling
-
-
Time#strftime
with a format string of
``%a
-
-
-
-
Time#strftime
with a format string of
-
-
-
- ``
%Y-%m-%d
%H:%M:%S
UTC
‘’
-
static VALUE
ã¨ã„ã†ã‚ã‘ã§ã€ä»Šã•ã‚‰ã§ã¯ã‚ã‚Šã¾ã™ãŒã€ç§ã¯
ã¨ã„ã†ã®ã‚’æ案ã—ã¾ã™ã€‚ãŒã€ã™ã£ã‹ã‚Šå¿˜ã‚Œã¦æ”¾ç½®ã—ã¦ã„ãŸã®ã¯ç§ã§
ã™ã—ã€ã‚‚ã†æ™‚期も時期ã§ã™ã‹ã‚‰ã€æœ€çµ‚çš„ãªåˆ¤æ–ã¯knuã•ã‚“ã«ä»»ã›ã¾
ã™ã€‚
 変ãˆã‚‹ã«è¶³ã‚‹ç†ç”±ãŒè¦‹ã¤ã‹ã‚‰ãªã„ã®ã§ã€ 1.8.6 㯠1.8.5 ã®ä»•æ§˜ã«
戻ãã†ã¨æ€ã„ã¾ã™ã€‚ã‚‚ã£ã¨æ—©ãçªã£è¾¼ã‚“ã§ãŠã‘ã°ã‚ˆã‹ã£ãŸã€‚
–
/
/__ __ Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp
“Different eyes see different things,
Different hearts beat on different strings –
But there are times for you and me when all such things agree”
e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B
In message “Re: [ruby-dev:30493] Re: Time#to_s format”
on Mon, 5 Mar 2007 22:15:13 +0900, “Akinori MUSHA”
[email protected] writes:
|e$B!!$H$3$m$G!"e(B 1.8.6 e$B$Ne(B Time#to_s e$B$re(B RFC 2822 e$B7A<0$K$9$k$H$$$&$N$Oe(B
|e$B:G=*7hDj$G$$$$$N$G$7$g$&$+!#e(B1.9 e$B$G$O$^$?0c$&7A<0$K$J$C$F$$$^$9$,!"e(B
|e$B$3$l$OJQ99$7K:$l$G$9$h$M!)e(B
|
|e$B!!e(B1.9 e$B$G$^$?JQ$($k$/$i$$$J$i!"e(B 1.8.6 e$B$GJQ$($k$N$OHr$1$?$$$N$G$9$,!#e(B
e$BFq$7$$$H$3$m$G$9!#;d$N85!9$N0U;W$Oe(Bctimee$BI=8=$G[#Kf@-$,Bg$-$$e(B
Timezonee$BI=8=$NItJ,$r?tCMI=8=$K$9$k$3$H$@$1$@$C$?$N$G$9$,!“e(B
Timezone$BI=8=$N0LCV$K$D$$$FG:$s$G$$$k$&$A$K$=$N$^$^e(BRFC2822e$B7A<0e(B
e$B$K$J$C$F$7$^$C$?$H$$$&7P0^$,$”$j$^$9e(B(e$BEv=i!"e(BRFC2822e$B$He(Bctimee$B7Ae(B
e$B<0$N0c$$$r==J,$KG’<1$7$F$$$J$+$C$?e(B)e$B!#e(B
e$B$G!"e(BRuby
1.9e$B$G$Oe(BISO8601e$B7A<0e(B(e$B$?$@$76h@Z$j$Ne(BTe$B$O;H$o$J$$e(B)e$B$K$7$he(B
e$B$&$H;W$C$F$$$^$9!#85!9e(B1.8e$B$NHO0OFb$G$O>.$5$JJQ99$K$7$F!"e(B1.9e$B$Ne(B
e$B$H$-$KBg$-$JJQ99$K$7$h$&$H;W$C$F$$$^$7$?$+$i!#e(B
e$B$H$$$&$o$1$G!“:#$5$i$G$O$”$j$^$9$,!";d$Oe(B
1.8e$B$NHO0OFb$G$Oe(BRFC2822e$B$O:NMQ$;$:!"e(BTimezonee$B$r?tCMI=8=$K$9e(B
e$B$k$@$1e(B(e$B$D$^$j!"e(B1.8.5e$B$N>uBV$KLa$9e(B)
- 1.9e$B$Ge(BISO8601e$B7A<0$Ke(B
e$B$H$$$&$N$rDs0F$7$^$9!#$,!“$9$C$+$jK:$l$FJ|CV$7$F$$$?$N$O;d$Ge(B
e$B$9$7!”$b$&;~4|$b;~4|$G$9$+$i!":G=E$JH=CG$Oe(Bknue$B$5$s$KG$$;$^e(B
e$B$9!#e(B
e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B
In message “Re: [ruby-dev:30499] Re: Time#to_s format”
on Tue, 6 Mar 2007 15:38:38 +0900, “Akinori MUSHA”
[email protected] writes:
|e$B!!$=$l$O$5$F$*$-!"e(B inspect e$B$Oe(B usec e$B$r4^$`7A<0$KJQ$($?J}$,$$$$$se(B
|e$B$8$c$J$$$G$7$g$&$+!#e(B(ctime e$B$de(B RFC 2822 e$B$Oe(B usec e$B$r4^$a$i$l$J$$e(B)
e$B$=$&$G$9$M$(!#e(BYAMLe$B7A<0$K$“$o$;$k$+$J$”!#e(B
|> e$B$G!"e(BRuby 1.9e$B$G$Oe(BISO8601e$B7A<0e(B(e$B$?$@$76h@Z$j$Ne(BTe$B$O;H$o$J$$e(B)e$B$K$7$he(B
|> e$B$&$H;W$C$F$$$^$9!#85!9e(B1.8e$B$NHO0OFb$G$O>.$5$JJQ99$K$7$F!“e(B1.9e$B$Ne(B
|> e$B$H$-$KBg$-$JJQ99$K$7$h$&$H;W$C$F$$$^$7$?$+$i!#e(B
|
|e$B!!e(B1.9 e$B$Ne(B rdoc e$B$O<BAu$rH?1G$7$F$$$^$;$s!#:#$N;EMM$Oe(B ISO 8601
|e$B$G$be(B YAML e$B=`5r$G$b$J$/CfESH>C<$J$N$G!”$3$N5!2q$K<BAu$bJQ$($Fe(B
|e$B$7$^$C$?J}$,$$$$$H;W$$$^$9$,!#e(B
e$B$=$&$G$9$M!#8=>ue(BISO8601e$B$K9g$C$F$J$$ItJ,$,$“$k$N$O3N$+$G$9!#e(B
e$B%?%$%`%>!<%s$N!Ve(BZe$B!W$,5$$KF~$i$J$$$s$G$9$h$M$(!#e(B
e$BBE6($9$k$+$J$”!#e(B