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
68a9446f
Commit
68a9446f
authored
Feb 12, 2001
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merged fix for 1963 from 2.3 branch
parent
5a55b862
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
lib/python/DateTime/DateTime.py
lib/python/DateTime/DateTime.py
+12
-5
No files found.
lib/python/DateTime/DateTime.py
View file @
68a9446f
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Encapsulation of date/time values"""
__version__
=
'$Revision: 1.
59
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
60
$'
[
11
:
-
2
]
import
sys
,
os
,
math
,
regex
,
ts_regex
,
DateTimeZone
...
...
@@ -1153,28 +1153,35 @@ class DateTime:
that falls within the current month, in the context
of this object
\
'
s timezone representation"""
t
=
time
()
return
safegmtime
(
t
+
_tzoffset
(
self
.
_tz
,
t
))[
1
]
==
self
.
_month
gmt
=
safegmtime
(
t
+
_tzoffset
(
self
.
_tz
,
t
))
return
gmt
[
0
]
==
self
.
_year
and
gmt
[
1
]
==
self
.
_month
def
isCurrentDay
(
self
):
"""Return true if this object represents a date/time
that falls within the current day, in the context
of this object
\
'
s timezone representation"""
t
=
time
()
return
safegmtime
(
t
+
_tzoffset
(
self
.
_tz
,
t
))[
2
]
==
self
.
_day
gmt
=
safegmtime
(
t
+
_tzoffset
(
self
.
_tz
,
t
))
return
gmt
[
0
]
==
self
.
_year
and
gmt
[
1
]
==
self
.
_month
and
gmt
[
2
]
==
self
.
_day
def
isCurrentHour
(
self
):
"""Return true if this object represents a date/time
that falls within the current hour, in the context
of this object
\
'
s timezone representation"""
t
=
time
()
return
safegmtime
(
t
+
_tzoffset
(
self
.
_tz
,
t
))[
3
]
==
self
.
_hour
gmt
=
safegmtime
(
t
+
_tzoffset
(
self
.
_tz
,
t
))
return
(
gmt
[
0
]
==
self
.
_year
and
gmt
[
1
]
==
self
.
_month
and
gmt
[
2
]
==
self
.
_day
and
gmt
[
3
]
==
self
.
_hour
)
def
isCurrentMinute
(
self
):
"""Return true if this object represents a date/time
that falls within the current minute, in the context
of this object
\
'
s timezone representation"""
t
=
time
()
return
safegmtime
(
t
+
_tzoffset
(
self
.
_tz
,
t
))[
4
]
==
self
.
_minute
gmt
=
safegmtime
(
t
+
_tzoffset
(
self
.
_tz
,
t
))
return
(
gmt
[
0
]
==
self
.
_year
and
gmt
[
1
]
==
self
.
_month
and
gmt
[
2
]
==
self
.
_day
and
gmt
[
3
]
==
self
.
_hour
and
gmt
[
4
]
==
self
.
_minute
)
def
earliestTime
(
self
):
"""Return a new DateTime object that represents the earliest
...
...
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