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
fa0e693a
Commit
fa0e693a
authored
Sep 07, 2008
by
Paul Winkler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for launchpad #267545: DateTime(DateTime()) should preserve the correct hour
parent
13ff3f46
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/DateTime/DateTime.py
lib/python/DateTime/DateTime.py
+1
-4
lib/python/DateTime/tests/testDateTime.py
lib/python/DateTime/tests/testDateTime.py
+6
-2
No files found.
doc/CHANGES.txt
View file @
fa0e693a
...
@@ -207,6 +207,9 @@ Zope Changes
...
@@ -207,6 +207,9 @@ Zope Changes
Bugs Fixed
Bugs Fixed
- Launchpad #267545: DateTime(DateTime()) now preserves the
correct hour
- Launchpad #262313: respect the 'Expand macros when editing' flag
- Launchpad #262313: respect the 'Expand macros when editing' flag
when editing a page template through the ZMI
when editing a page template through the ZMI
...
...
lib/python/DateTime/DateTime.py
View file @
fa0e693a
...
@@ -586,11 +586,8 @@ class DateTime:
...
@@ -586,11 +586,8 @@ class DateTime:
DateTime instance.
DateTime instance.
"""
"""
t
=
arg
.
timeTime
()
t
=
arg
.
timeTime
()
tz
=
arg
.
timezone
()
ms
=
(
t
-
math
.
floor
(
t
))
s
,
d
=
_calcSD
(
t
)
s
,
d
=
_calcSD
(
t
)
yr
,
mo
,
dy
,
hr
,
mn
,
sc
=
gmtime
(
t
)[:
6
]
yr
,
mo
,
dy
,
hr
,
mn
,
sc
,
tz
=
arg
.
parts
()
sc
=
sc
+
ms
elif
isinstance
(
arg
,
datetime
):
elif
isinstance
(
arg
,
datetime
):
yr
,
mo
,
dy
,
hr
,
mn
,
sc
,
numerictz
,
tznaive
=
self
.
_parse_iso8601_preserving_tznaive
(
arg
.
isoformat
())
yr
,
mo
,
dy
,
hr
,
mn
,
sc
,
numerictz
,
tznaive
=
self
.
_parse_iso8601_preserving_tznaive
(
arg
.
isoformat
())
...
...
lib/python/DateTime/tests/testDateTime.py
View file @
fa0e693a
...
@@ -401,8 +401,10 @@ class DateTimeTests(unittest.TestCase):
...
@@ -401,8 +401,10 @@ class DateTimeTests(unittest.TestCase):
def
testCopyConstructor
(
self
):
def
testCopyConstructor
(
self
):
d
=
DateTime
(
'2004/04/04'
)
d
=
DateTime
(
'2004/04/04'
)
self
.
assertEqual
(
DateTime
(
d
),
d
)
self
.
assertEqual
(
DateTime
(
d
),
d
)
d
=
DateTime
(
'1999/04/12'
)
self
.
assertEqual
(
str
(
DateTime
(
d
)),
str
(
d
))
self
.
assertEqual
(
DateTime
(
d
),
d
)
d2
=
DateTime
(
'1999/04/12 01:00:00'
)
self
.
assertEqual
(
DateTime
(
d2
),
d2
)
self
.
assertEqual
(
str
(
DateTime
(
d2
)),
str
(
d2
))
def
testCopyConstructorPreservesTimezone
(
self
):
def
testCopyConstructorPreservesTimezone
(
self
):
# test for https://bugs.launchpad.net/zope2/+bug/200007
# test for https://bugs.launchpad.net/zope2/+bug/200007
...
@@ -413,8 +415,10 @@ class DateTimeTests(unittest.TestCase):
...
@@ -413,8 +415,10 @@ class DateTimeTests(unittest.TestCase):
self
.
assertEqual
(
DateTime
(
d
).
timezone
(),
d
.
timezone
())
self
.
assertEqual
(
DateTime
(
d
).
timezone
(),
d
.
timezone
())
d2
=
DateTime
(
'2008/04/25 12:00:00 EST'
)
d2
=
DateTime
(
'2008/04/25 12:00:00 EST'
)
self
.
assertEqual
(
DateTime
(
d2
).
timezone
(),
d2
.
timezone
())
self
.
assertEqual
(
DateTime
(
d2
).
timezone
(),
d2
.
timezone
())
self
.
assertEqual
(
str
(
DateTime
(
d2
)),
str
(
d2
))
d3
=
DateTime
(
'2008/04/25 12:00:00 PST'
)
d3
=
DateTime
(
'2008/04/25 12:00:00 PST'
)
self
.
assertEqual
(
DateTime
(
d3
).
timezone
(),
d3
.
timezone
())
self
.
assertEqual
(
DateTime
(
d3
).
timezone
(),
d3
.
timezone
())
self
.
assertEqual
(
str
(
DateTime
(
d3
)),
str
(
d3
))
def
testRFC822
(
self
):
def
testRFC822
(
self
):
...
...
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