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

ruby-changes:21021

From: akr <ko1@a...>
Date: Fri, 26 Aug 2011 01:39:48 +0900 (JST)
Subject: [ruby-changes:21021] akr:r33070 (trunk): update doc.

akr	2011-08-26 01:39:37 +0900 (Fri, 26 Aug 2011)

  New Revision: 33070

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

  Log:
    update doc.

  Modified files:
    trunk/time.c

Index: time.c
===================================================================
--- time.c	(revision 33069)
+++ time.c	(revision 33070)
@@ -4473,12 +4473,23 @@
  *  This method is similar to strftime() function defined in ISO C and POSIX.
  *  Several directives (%a, %A, %b, %B, %c, %p, %r, %x, %X, %E*, %O* and %Z)
  *  are locale dependent in the function.
- *  However this method is locale independent since Ruby 1.9.
+ *  However this method is almost locale independent since Ruby 1.9.
+ *  (%Z is only the locale dependent directive.)
  *  So, the result may differ even if a same format string is used in other
  *  systems such as C.
  *  It is good practice to avoid %x and %X because there are corresponding
  *  locale independent representations, %D and %T.
  *
+ *  %z is recommended over %Z.
+ *  %Z doesn't identify the timezone.
+ *  For example, "CST" is used at America/Chicago (-06:00),
+ *  America/Havana (-05:00), Asia/Harbin (+08:00), Australia/Darwin (+09:30)
+ *  and Australia/Adelaide (+10:30).
+ *  Also, %Z is highly dependent for OS.
+ *  For example, it may generate a non ASCII string on Japanese Windows.
+ *  i.e. the result can be different to "JST".
+ *  So the numeric time zone offset, %z, is recommended.
+ *
  *  Examples:
  *
  *    t = Time.new(2007,11,19,8,37,48,"-06:00") #=> 2007-11-19 08:37:48 -0600

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

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