Created
July 20, 2009 22:46
-
-
Save baroquebobcat/150968 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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