diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-17 23:55:17 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-17 23:55:17 +0000 |
commit | 73c8156360db536af7e64b062bda1bdd4454719d (patch) | |
tree | 201df634529e172243a1ae94c6566c11f86ccb2d /time.c | |
parent | 4d16ce7da4b142d411513048895972d682a45d0f (diff) |
* time.c (time_succ): Time#succ should return a time object in the
same timezone mode to the original. [ruby-talk:260256]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1337,9 +1337,14 @@ static VALUE time_succ(VALUE time) { struct time_object *tobj; + int gmt; GetTimeval(time, tobj); - return rb_time_new(tobj->tv.tv_sec + 1, tobj->tv.tv_usec); + gmt = tobj->gmt; + time = rb_time_new(tobj->tv.tv_sec + 1, tobj->tv.tv_usec); + GetTimeval(time, tobj); + tobj->gmt = gmt; + return time; } /* |