Hello,
I used joda-time in some prototyping code to do a simple time zone
conversion and ran into an issue. It’s almost certainly related to the
version of joda-time on the classpath (1.6) and that which is bundled
with JRuby (I am running 1.7.0 dev).
I’m only curious how to make this work, as the required functionality
has been implemented and tested in Java. (Ideally however I would be
able to migrate the lonely JUnit test to our JRuby/RSpec suite).
java_import org.joda.time.DateTime
java_import org.joda.time.DateTimeZone
local = DateTime.new
tz = org.joda.time.DateTimeZone.forID(‘GMT0’)
tz.class.should == org.joda.time.tz.FixedDateTimeZone # n.b. we get back
a FixedDateTimeZone…
gmt = DateTime.new(tz) # woops:
Failure/Error: gmt = DateTime.new(tz)
NativeException:
java.lang.IllegalArgumentException: No instant converter found
for type: org.joda.time.tz.FixedDateTimeZone
# org/joda/time/convert/ConverterManager.java:165:in
getInstantConverter' # org/joda/time/base/BaseDateTime.java:169:in
’
# org/joda/time/DateTime.java:168:in <init>' # sun/reflect/NativeConstructorAccessorImpl.java:-2:in
newInstance0’
# sun/reflect/NativeConstructorAccessorImpl.java:39:in
newInstance' # sun/reflect/DelegatingConstructorAccessorImpl.java:27:in
newInstance’
# java/lang/reflect/Constructor.java:513:in `newInstance’
…
===
And I’d like to take this opportunity to thank the JRuby community for
all their great hard work.
Regards,
Edward
$ jruby --version
jruby 1.7.0.dev (ruby-1.9.2-p136) (2011-10-03 731b4e2) (Java HotSpot™
64-Bit Server VM 1.6.0_27) [linux-amd64-java]