summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-09 10:28:37 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-09 10:28:37 +0000
commite66f0d429f3a4201465f7e1d4f4d4d87d4e4fd24 (patch)
tree97d6289f5de5fc05126e4e062b05a4f437ca2665 /lib
parent4f4279c2531024b5bfaf5f5e4205742ad1f75c97 (diff)
downloadruby-e66f0d429f3a4201465f7e1d4f4d4d87d4e4fd24.tar.gz
ruby-e66f0d429f3a4201465f7e1d4f4d4d87d4e4fd24.tar.xz
ruby-e66f0d429f3a4201465f7e1d4f4d4d87d4e4fd24.zip
* lib/date.rb: use subsec instead of nsec.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/date.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/date.rb b/lib/date.rb
index 2c9792562..ce1d32712 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -1775,7 +1775,7 @@ class Time
def to_datetime
jd = DateTime.__send__(:civil_to_jd, year, mon, mday, DateTime::ITALY)
fr = DateTime.__send__(:time_to_day_fraction, hour, min, [sec, 59].min) +
- Rational(nsec, 86400_000_000_000)
+ Rational(subsec, 86400)
of = Rational(utc_offset, 86400)
DateTime.new!(DateTime.__send__(:jd_to_ajd, jd, fr, of),
of, DateTime::ITALY)
@@ -1805,7 +1805,7 @@ class Date
t = Time.now
jd = civil_to_jd(t.year, t.mon, t.mday, sg)
fr = time_to_day_fraction(t.hour, t.min, [t.sec, 59].min) +
- Rational(t.nsec, 86400_000_000_000)
+ Rational(t.subsec, 86400)
of = Rational(t.utc_offset, 86400)
new!(jd_to_ajd(jd, fr, of), of, sg)
end