Forum: JRuby how to comparing java date with ruby date

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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
java.util.Date



--
View this message in context:
http://www.nabble.com/how-to-comparing-java-date-w...
Sent from the JRuby - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.