diff options
| author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-05 12:50:08 +0000 |
|---|---|---|
| committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-05 12:50:08 +0000 |
| commit | 342cb2406dc473d0dd911c00861673db067c6e5b (patch) | |
| tree | 707bb457e16b448ed5c6852fa6f07c5aa23cfb5d /time.c | |
| parent | aefb5e2647e3a39048ff65caa15fa44a8c849067 (diff) | |
| download | ruby-342cb2406dc473d0dd911c00861673db067c6e5b.tar.gz ruby-342cb2406dc473d0dd911c00861673db067c6e5b.tar.xz ruby-342cb2406dc473d0dd911c00861673db067c6e5b.zip | |
* time.c (time_to_s): Correct the wrong format which did not
really conform to RFC 2822; pointed out by: OHARA Shigeki <os at
iij.ad.jp> in [ruby-dev:30487].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6@11997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
| -rw-r--r-- | time.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1239,11 +1239,11 @@ time_asctime(time) * time.to_s => string * * Returns a string representing <i>time</i>. Equivalent to calling - * <code>Time#strftime</code> with a format string of ``<code>%a</code> - * <code>%b</code> <code>%d</code> <code>%H:%M:%S</code> - * <code>%Z</code> <code>%Y</code>''. + * <code>Time#strftime</code> with a format string of ``<code>%a,</code> + * <code>%d</code> <code>%b</code> <code>%H:%M:%S</code> + * <code>%Z</code> <code>%Y</code>'' (the RFC 2822 style). * - * Time.now.to_s #=> "Wed Apr 09 08:56:04 CDT 2003" + * Time.now.to_s #=> "Wed 09 Apr 08:56:04 CDT 2003" */ static VALUE @@ -1274,7 +1274,7 @@ time_to_s(time) sign = '-'; off = -off; } - sprintf(buf2, "%%a, %%b %%d %%Y %%H:%%M:%%S %c%02d%02d", + sprintf(buf2, "%%a, %%d %%b %%Y %%H:%%M:%%S %c%02d%02d", sign, (int)(off/3600), (int)(off%3600/60)); len = strftime(buf, 128, buf2, &tobj->tm); return rb_str_new(buf, len); |
