Project

General

Profile

Bug #2396

Time.strftime returns a wrong time zone as hour offset (%z)

Added by chulkilee (Chulki Lee) over 9 years ago. Updated over 8 years ago.

Status:
Third Party's Issue
Priority:
Normal
Target version:
-
ruby -v:
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]
[ruby-core:26894]

Description

=begin
Time.now
=> Tue Nov 24 20:47:11 +0900 2009

Time.now.strftime("%a %b %e %H:%M:%S %z %Y (%Z)")
=> Tue Nov 24 20:47:11 +0800 2009 (KST)
=end


Files

tz.c (373 Bytes) tz.c nobu (Nobuyoshi Nakada), 11/28/2009 10:27 PM

History

#1

Updated by ujihisa (Tatsuhiro Ujihisa) over 9 years ago

  • Status changed from Open to Assigned
  • Assignee set to nobu (Nobuyoshi Nakada)

=begin

=end

#2

Updated by chulkilee (Chulki Lee) over 9 years ago

=begin
Maybe a platform-dependent problem? (tzdata?)

Ubuntu 9.04, package ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
=> working CORRECTLY - "+0900 (KST)"

Mac OS X 10.6.2, macport ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]
=> working INCORRECTLY - "+0800 (KST)"

Mac OS X 10.6.2, apple ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
=> working INCORRECTLY - "+0800 (KST)"
=end

#3

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • File tz.c tz.c added
  • Status changed from Assigned to Third Party's Issue

=begin
Seems a bug of Mac OS X's strftime().

$ uname -v
Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386
$ ./tz
tm_gmtoff = +0900, tm_zone = KST
tm_gmtoff = +0800, tm_zone = KST

Ruby 1.9 doesn't have this issue, since it uses missing/strftime.c.

=end

Also available in: Atom PDF