From c8d25db6e4f514f253190c15ec9fb0bcfbcf8b7f Mon Sep 17 00:00:00 2001 From: Charles Korn Date: Sun, 1 Feb 2015 11:12:05 +1100 Subject: [PATCH] Adding additional information to documentation for Time#getlocal - include examples of valid utc_offset formats --- time.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/time.c b/time.c index 53b3cde..557b260 100644 --- a/time.c +++ b/time.c @@ -3585,6 +3585,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. "+09:00") + * or as a number of seconds (eg. 32400). * * t = Time.utc(2000,1,1,20,15,1) #=> 2000-01-01 20:15:01 UTC * t.utc? #=> true @@ -3596,6 +3598,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 -- 2.3.0