[前][次][番号順一覧][スレッド一覧]

ruby-changes:34899

From: zzak <ko1@a...>
Date: Mon, 28 Jul 2014 05:58:15 +0900 (JST)
Subject: [ruby-changes:34899] zzak:r46982 (trunk): * time.c: [DOC] Clarify %Y in strftime, which can accept any digits

zzak	2014-07-28 05:58:05 +0900 (Mon, 28 Jul 2014)

  New Revision: 46982

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46982

  Log:
    * time.c: [DOC] Clarify %Y in strftime, which can accept any digits
      and will output at least 4 digits as the year. Reported by Yury
      Trofimenko [Bug #8941]

  Modified files:
    trunk/ChangeLog
    trunk/lib/time.rb
    trunk/time.c
Index: time.c
===================================================================
--- time.c	(revision 46981)
+++ time.c	(revision 46982)
@@ -4399,7 +4399,7 @@ strftimev(const char *fmt, VALUE time, r https://github.com/ruby/ruby/blob/trunk/time.c#L4399
  *  Format directives:
  *
  *    Date (Year, Month, Day):
- *      %Y - Year with century (can be negative, 4 digits at least)
+ *      %Y - Year with century if provided, will pad result at least 4 digits.
  *              -0001, 0000, 1995, 2009, 14292, etc.
  *      %C - year / 100 (rounded down such as 20 in 2009)
  *      %y - year % 100 (00..99)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46981)
+++ ChangeLog	(revision 46982)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jul 28 05:55:56 2014  Zachary Scott  <e@z...>
+
+	* time.c: [DOC] Clarify %Y in strftime, which can accept any digits
+	  and will output at least 4 digits as the year. Reported by Yury
+	  Trofimenko [Bug #8941]
+
+	* lib/time.rb: ditto
+
 Mon Jul 28 05:32:06 2014  Zachary Scott  <e@z...>
 
 	* lib/uri/common.rb: [DOC] [Bug #10075] Clarify how URI.join arguments
Index: lib/time.rb
===================================================================
--- lib/time.rb	(revision 46981)
+++ lib/time.rb	(revision 46982)
@@ -417,7 +417,7 @@ class Time https://github.com/ruby/ruby/blob/trunk/lib/time.rb#L417
     # %x :: Preferred representation for the date alone, no time
     # %X :: Preferred representation for the time alone, no date
     # %y :: Year without a century (00..99)
-    # %Y :: Year with century
+    # %Y :: Year which may include century, if provided
     # %z :: Time zone as  hour offset from UTC (e.g. +0900)
     # %Z :: Time zone name
     # %% :: Literal "%" character

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]