Forum: JRuby how to comparing java date with ruby date

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
glenanderson (Guest)
on 2009-05-22 08:24
(Received via mailing list)
How can I compare a Ruby Date with Java Date.  E.g.

include Java
require 'date'
rbdate = Date.parse("2008-08-01")
formatter = java.text.SimpleDateFormat("yyyy/MM/dd")
jdate = formatter.parse("2009/02/01")
puts "date comparison" if jdate > rbdate

currently an exception is thrown stating a ruby object cannot be cast to

View this message in context:
Sent from the JRuby - User mailing list archive at

To unsubscribe from this list, please visit:
This topic is locked and can not be replied to.