summaryrefslogtreecommitdiff
path: root/lib/date
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-22 15:26:58 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-22 15:26:58 +0000
commit0e866a2e516d5b7bea0a602d1048b5bdc22a2f98 (patch)
tree09eedee80d964377eaec8582e67e7450efac66bd /lib/date
parent47993929c4727ec1e7e7af4b2d2177d0058b84f8 (diff)
updated to the new version (based on date2 3.3).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date')
-rw-r--r--lib/date/format.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/date/format.rb b/lib/date/format.rb
index 7b10d56041..e099854aa4 100644
--- a/lib/date/format.rb
+++ b/lib/date/format.rb
@@ -1,5 +1,5 @@
# format.rb: Written by Tadayoshi Funaba 1999-2002
-# $Id: format.rb,v 2.7 2002-05-17 21:20:28+09 tadf Exp $
+# $Id: format.rb,v 2.8 2002-06-08 00:39:51+09 tadf Exp $
class Date
@@ -409,6 +409,12 @@ class Date
zone = $4
end
+ if str.sub!(/\b(bc\b|bce\b|b\.c\.|b\.c\.e\.)/ino, ' ')
+ if year
+ year = -year + 1
+ end
+ end
+
if comp and year
if year >= 0 and year <= 99
if year >= 69
@@ -477,7 +483,7 @@ class Date
when '%r'; o << strftime('%I:%M:%S %p') # P2,ID
when '%S'; o << '%02d' % sec
when '%s' # TZ,GL
- d = rjd - type.jd_to_rjd(type.civil_to_jd(1970,1,1), 0)
+ d = ajd - type.jd_to_ajd(type.civil_to_jd(1970,1,1), 0)
s = (d * 86400).to_i
o << '%d' % s
when '%T'; o << strftime('%H:%M:%S') # P2,ID