summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-14 11:10:49 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-14 11:10:49 +0000
commit3093ffab83bdac5c4fcb61716d6eb13b2fcab0a5 (patch)
tree39d28e57e96051e0e5c1af9ba152079846c1b88b
parent9bcff8dbe9cbe1054e2d8dac0c24cc87548207f8 (diff)
* time.c (time_getlocaltime): [DOC] Add examples of valid utc_offset
formats. [ruby-core:68306] [Misc #10905] Patch by Charles Korn. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--time.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4098713b603..d44e74b5093 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Jun 14 20:09:25 2015 Tanaka Akira <akr@fsij.org>
+
+ * time.c (time_getlocaltime): [DOC] Add examples of valid utc_offset
+ formats.
+ [ruby-core:68306] [Misc #10905] Patch by Charles Korn.
+
Sun Jun 14 18:49:56 2015 Tanaka Akira <akr@fsij.org>
* ext/socket/raddrinfo.c (parse_numeric_port): Detect
diff --git a/time.c b/time.c
index 0d696ba68c6..c1c73699a02 100644
--- a/time.c
+++ b/time.c
@@ -3581,6 +3581,8 @@ time_fixoff(VALUE time)
* local time (using the local time zone in effect for this process).
*
* If +utc_offset+ is given, it is used instead of the local time.
+ * +utc_offset+ can be given as a human-readable string (eg. <code>"+09:00"</code>)
+ * or as a number of seconds (eg. <code>32400</code>).
*
* t = Time.utc(2000,1,1,20,15,1) #=> 2000-01-01 20:15:01 UTC
* t.utc? #=> true
@@ -3592,6 +3594,10 @@ time_fixoff(VALUE time)
* j = t.getlocal("+09:00") #=> 2000-01-02 05:15:01 +0900
* j.utc? #=> false
* t == j #=> true
+ *
+ * k = t.getlocal(9*60*60) #=> 2000-01-02 05:15:01 +0900
+ * k.utc? #=> false
+ * t == k #=> true
*/
static VALUE