summaryrefslogtreecommitdiffstats
path: root/strftime.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-24 12:42:45 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-24 12:42:45 +0000
commited0d7ef77f0d659720b4c9b211b8e91fde64472c (patch)
tree38a80b71c68bbb0867a2d47d194702737cc499f5 /strftime.c
parent61e706902381269659c41e1b1c3b877d8ec269d4 (diff)
downloadruby-ed0d7ef77f0d659720b4c9b211b8e91fde64472c.tar.gz
ruby-ed0d7ef77f0d659720b4c9b211b8e91fde64472c.tar.xz
ruby-ed0d7ef77f0d659720b4c9b211b8e91fde64472c.zip
* strftime.c (rb_strftime): The default precision should be 1, not
0. [ruby-dev:37155] * test/ruby/test_time.rb (test_strftime): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/strftime.c b/strftime.c
index af66fa637..5565a9be0 100644
--- a/strftime.c
+++ b/strftime.c
@@ -405,7 +405,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
case 'w': /* weekday, Sunday == 0, 0 - 6 */
i = range(0, timeptr->tm_wday, 6);
- FMT('0', 0, "d", i);
+ FMT('0', 1, "d", i);
continue;
case 'W': /* week of year, Monday is first day of week */
@@ -426,7 +426,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
continue;
case 'Y': /* year with century */
- FMT('0', 0, "ld", 1900L + timeptr->tm_year);
+ FMT('0', 1, "ld", 1900L + timeptr->tm_year);
continue;
#ifdef MAILHEADER_EXT
@@ -623,7 +623,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
case 'u':
/* ISO 8601: Weekday as a decimal number [1 (Monday) - 7] */
- FMT('0', 0, "d", timeptr->tm_wday == 0 ? 7 : timeptr->tm_wday);
+ FMT('0', 1, "d", timeptr->tm_wday == 0 ? 7 : timeptr->tm_wday);
continue;
#endif /* POSIX2_DATE */
@@ -648,7 +648,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
y = 1900L + timeptr->tm_year;
if (*format == 'G')
- FMT('0', 0, "ld", y);
+ FMT('0', 1, "ld", y);
else
FMT('0', 2, "ld", y % 100);
continue;