summaryrefslogtreecommitdiff
path: root/lib/date/format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/date/format.rb')
-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