Time#strftime week of year is broken on some systems
----------------------------------------------------
Key: JRUBY-1999
URL: http://jira.codehaus.org/browse/JRUBY-1999
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.x
Environment: Ubuntu 7.10, Java(TM) SE Runtime Environment (build
1.6.0_03-b05), jruby trunk, GMT
Reporter: Damian Steer
Assignee: Thomas E Enebo
Attachments: week_of_year_bug.rb
On my ubuntu machine trunk tests fail:
{noformat}
FAILED Test Time: 41 expected "Got 00", found "Got 51"-- test/testTime.rb:97
FAILED Test Time: 42 expected "Got 00", found "Got 51"-- test/testTime.rb:97
{noformat}
But this is _not_ the case for my macs, and VVSiz's ubuntu machine (which
sounds identical). Timezone issue?
Attached is a quick script which shows how confused jruby is. Output from MRI
and jruby:
{noformat}
[EMAIL PROTECTED]:/tmp/jruby$ ruby week_of_year_bug.rb
2000-01-01 01:01:01 +0000 Week (Mon): 00 Week (Sun): 00
2000-01-02 01:01:01 +0000 Week (Mon): 00 Week (Sun): 01
2000-01-03 01:01:01 +0000 Week (Mon): 01 Week (Sun): 01
2000-01-04 01:01:01 +0000 Week (Mon): 01 Week (Sun): 01
2000-01-05 01:01:01 +0000 Week (Mon): 01 Week (Sun): 01
2000-01-06 01:01:01 +0000 Week (Mon): 01 Week (Sun): 01
2000-01-07 01:01:01 +0000 Week (Mon): 01 Week (Sun): 01
2000-01-08 01:01:01 +0000 Week (Mon): 01 Week (Sun): 01
2000-01-09 01:01:01 +0000 Week (Mon): 01 Week (Sun): 02
[EMAIL PROTECTED]:/tmp/jruby$ jruby week_of_year_bug.rb
Sat Jan 01 01:01:01 UTC 2000 Week (Mon): 51 Week (Sun): 51
Sun Jan 02 01:01:01 UTC 2000 Week (Mon): 51 Week (Sun): 01
Mon Jan 03 01:01:01 UTC 2000 Week (Mon): 01 Week (Sun): 00
Tue Jan 04 01:01:01 UTC 2000 Week (Mon): 00 Week (Sun): 00
Wed Jan 05 01:01:01 UTC 2000 Week (Mon): 00 Week (Sun): 00
Thu Jan 06 01:01:01 UTC 2000 Week (Mon): 00 Week (Sun): 00
Fri Jan 07 01:01:01 UTC 2000 Week (Mon): 00 Week (Sun): 00
Sat Jan 08 01:01:01 UTC 2000 Week (Mon): 00 Week (Sun): 00
Sun Jan 09 01:01:01 UTC 2000 Week (Mon): 00 Week (Sun): 02
{noformat}
Looks like a simple off-by-one issue, but with a tasty side order of timezones
:-)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email