Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
5b1ce09f
Commit
5b1ce09f
authored
Nov 13, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged fix for subtraction over DST boundaries from 2.2. branch
parent
7501dfa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lib/python/DateTime/DateTime.py
lib/python/DateTime/DateTime.py
+7
-3
No files found.
lib/python/DateTime/DateTime.py
View file @
5b1ce09f
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
##############################################################################
##############################################################################
"""Encapsulation of date/time values"""
"""Encapsulation of date/time values"""
__version__
=
'$Revision: 1.5
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.5
8
$'
[
11
:
-
2
]
import
sys
,
os
,
math
,
regex
,
ts_regex
,
DateTimeZone
import
sys
,
os
,
math
,
regex
,
ts_regex
,
DateTimeZone
...
@@ -1525,8 +1525,12 @@ class DateTime:
...
@@ -1525,8 +1525,12 @@ class DateTime:
"""Either a DateTime or a number may be subtracted from a
"""Either a DateTime or a number may be subtracted from a
DateTime, however, a DateTime may not be subtracted from
DateTime, however, a DateTime may not be subtracted from
a number."""
a number."""
try: return self._d-other._d
if hasattr(other, '
_d
'):
except: return self.__add__(-(other))
my_t = self._t + _tzoffset(self._tz, self._t)
ob_t = other._t + _tzoffset(other._tz, other._t)
return (my_t - ob_t) / 86400.0
else:
return self.__add__(-(other))
def __repr__(self):
def __repr__(self):
"""Convert a DateTime to a string that
"""Convert a DateTime to a string that
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment