diff options
| author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-22 15:26:58 +0000 |
|---|---|---|
| committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-22 15:26:58 +0000 |
| commit | d8e069567b30411d6587a47bf9b1051677dba077 (patch) | |
| tree | 09eedee80d964377eaec8582e67e7450efac66bd /lib/date/format.rb | |
| parent | ef408c00bea0b80117c4aa28d9769fa2d54af20f (diff) | |
| download | ruby-d8e069567b30411d6587a47bf9b1051677dba077.tar.gz ruby-d8e069567b30411d6587a47bf9b1051677dba077.tar.xz ruby-d8e069567b30411d6587a47bf9b1051677dba077.zip | |
updated to the new version (based on date2 3.3).
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date/format.rb')
| -rw-r--r-- | lib/date/format.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/date/format.rb b/lib/date/format.rb index 7b10d5604..e099854aa 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 |
