summaryrefslogtreecommitdiff
path: root/lib/date.rb
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-20 00:56:08 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-20 00:56:08 +0000
commit87f9d9e0c1f780d9cf7808d5b5af2f44234c30db (patch)
treea8ceb224eac27c30f12d0915c822daaaef34a944 /lib/date.rb
parent55a14a81169e22d220ff10cc68c4621b7e956a88 (diff)
synchronized with date2 3.6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date.rb')
-rw-r--r--lib/date.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/date.rb b/lib/date.rb
index 0747da1295..fabdc5bdc7 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -6,7 +6,7 @@
# Documentation: William Webber <william@williamwebber.com>
#
#--
-# $Id: date.rb,v 2.11 2004-01-19 04:56:12+09 tadf Exp $
+# $Id: date.rb,v 2.12 2004-03-20 08:05:13+09 tadf Exp $
#++
#
# == Overview
@@ -1196,16 +1196,18 @@ class DateTime < Date
def self.new_with_hash(elem, sg)
elem ||= {}
- y, m, d, h, min, s, of =
- elem.values_at(:year, :mon, :mday, :hour, :min, :sec, :offset)
+ y, m, d, h, min, s, fr, of =
+ elem.values_at(:year, :mon, :mday,
+ :hour, :min, :sec, :sec_fraction, :offset)
h ||= 0
min ||= 0
s ||= 0
+ fr ||= 0
of ||= 0
if [y, m, d].include? nil
raise ArgumentError, 'invalid date'
else
- civil(y, m, d, h, min, s, of.to_r/86400, sg)
+ civil(y, m, d, h, min, s, of.to_r/86400, sg) + (fr/86400)
end
end