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
df85e900
Commit
df85e900
authored
Mar 27, 2001
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged fix for correct exception throwing
parent
b1a51989
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
lib/python/DateTime/DateTime.py
lib/python/DateTime/DateTime.py
+13
-9
No files found.
lib/python/DateTime/DateTime.py
View file @
df85e900
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Encapsulation of date/time values"""
__version__
=
'$Revision: 1.6
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.6
3
$'
[
11
:
-
2
]
import
sys
,
os
,
math
,
regex
,
ts_regex
,
DateTimeZone
...
...
@@ -647,7 +647,7 @@ class DateTime:
year, the second is taken to be an integer month, and
the third is taken to be an integer day. If the
combination of values is not valid, then a
Date
Time
Error is raised. Two-digit years are assumed
DateError is raised. Two-digit years are assumed
to be in the twentieth century. The fourth, fifth, and
sixth arguments specify a time in hours, minutes, and
seconds; hours and minutes should be positive integers
...
...
@@ -658,8 +658,9 @@ class DateTime:
at that time on a machine in the specified timezone).
If a string argument passed to the DateTime constructor cannot be
parsed, it will raise DateTime.SyntaxError. Invalid date, time, or
timezone components will raise a DateTime.DateTimeError.
parsed, it will raise DateTime.SyntaxError. Invalid date components
will raise a DateError, while invalid time or timezone components
will raise a DateTimeError.
The module function Timezones() will return a list of the
timezones recognized by the DateTime module. Recognition of
...
...
@@ -1042,25 +1043,28 @@ class DateTime:
if
year
<
1000
:
raise
self
.
SyntaxError
,
string
leap
=
year
%
4
==
0
and
(
year
%
100
!=
0
or
year
%
400
==
0
)
try
:
if
not
day
or
day
>
self
.
_month_len
[
leap
][
month
]:
raise
self
.
SyntaxError
,
string
raise
self
.
DateError
,
string
except
IndexError
:
raise
self
.
DateError
,
string
tod
=
0
if
ints
:
i
=
ints
[
0
]
# Modify hour to reflect am/pm
if
tm
and
(
tm
==
'pm'
)
and
i
<
12
:
i
=
i
+
12
if
tm
and
(
tm
==
'am'
)
and
i
==
12
:
i
=
0
if
i
>
24
:
raise
self
.
Syntax
Error
,
string
if
i
>
24
:
raise
self
.
DateTime
Error
,
string
tod
=
tod
+
int
(
i
)
*
3600
del
ints
[
0
]
if
ints
:
i
=
ints
[
0
]
if
i
>
60
:
raise
self
.
Syntax
Error
,
string
if
i
>
60
:
raise
self
.
DateTime
Error
,
string
tod
=
tod
+
int
(
i
)
*
60
del
ints
[
0
]
if
ints
:
i
=
ints
[
0
]
if
i
>
60
:
raise
self
.
Syntax
Error
,
string
if
i
>
60
:
raise
self
.
DateTime
Error
,
string
tod
=
tod
+
i
del
ints
[
0
]
if
ints
:
raise
self
.
SyntaxError
,
string
...
...
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