Sync lib/date.rb from JRuby.
Sync lib/open3.rb from JRuby.