From: Tanaka Akira Date: 2012-06-28T09:29:39+09:00 Subject: [ruby-core:45922] Re: [ruby-trunk - Bug #6656][Open] Time#strftime('%Z') should return 'UTC' instead of 'GMT' 2012/6/27 stomar (Marcus Stollsteimer) : > > Issue #6656 has been reported by stomar (Marcus Stollsteimer). > Time#strftime('%Z') should return 'UTC' instead of 'GMT', > as in Time#to_s and Time#zone. This is also the behaviour of Ruby 1.9.3. > > irb(main):001:0> Time.utc(2012, 6, 27).to_s > => "Wed Jun 27 00:00:00 UTC 2012" > irb(main):002:0> Time.utc(2012, 6, 27).zone > => "UTC" > irb(main):003:0> Time.utc(2012, 6, 27).strftime('%Z') > => "GMT" Ruby 1.8 uses strftime() in libc. Ruby 1.9 uses own strftime() which %Z should produce UTC. % ruby-1.8.7p357 -ve 'p Time.utc(2012, 6, 27).strftime("%Z")' ruby 1.8.7 (2011-12-28 patchlevel 357) [x86_64-linux] "GMT" % ruby-1.9.3p194 -ve 'p Time.utc(2012, 6, 27).strftime("%Z")' ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] "UTC" Do you really sure that it returns "GMT" with Ruby 1.9.3? -- Tanaka Akira