Project

General

Profile

Actions

Bug #2396

closed

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

Added by chulkilee (Chulki Lee) over 14 years ago. Updated almost 13 years ago.

Status:
Third Party's Issue
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
Actions #1

Updated by ujihisa (Tatsuhiro Ujihisa) over 14 years ago

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

=begin

=end

Actions #2

Updated by chulkilee (Chulki Lee) over 14 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

Actions #3

Updated by nobu (Nobuyoshi Nakada) over 14 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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0