Skip to content

Instantly share code, notes, and snippets.

@baroquebobcat
Created July 20, 2009 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baroquebobcat/150968 to your computer and use it in GitHub Desktop.
Save baroquebobcat/150968 to your computer and use it in GitHub Desktop.
#fun with jruby dates
#
#perhaps related to
# http://jira.codehaus.org/browse/JRUBY-2541
#
require 'date'
puts Time.now.to_s, DateTime.now.to_s
begin
require 'java'
puts java.util.Date.new.to_s
rescue LoadError
puts 'java'
end
#
#$ ruby time_test.rb
#Mon Jul 20 17:28:38 -0500 2009
#2009-07-20T17:28:38-05:00
#java
#$ jruby time_test.rb
#Mon Jul 20 22:44:18 UTC 2009
#2009-07-20T22:44:18+00:00
#Mon Jul 20 17:44:19 CDT 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment