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
e1c2c430
Commit
e1c2c430
authored
Apr 01, 1997
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a precision bug when DateTimes were created with no args.
parent
3b742826
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
lib/python/DateTime/DateTime.py
lib/python/DateTime/DateTime.py
+5
-2
No files found.
lib/python/DateTime/DateTime.py
View file @
e1c2c430
...
...
@@ -44,7 +44,7 @@
"""Encapsulation of date/time values"""
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
import
sys
,
os
,
regex
,
DateTimeZone
...
...
@@ -401,6 +401,7 @@ class DateTime:
# Current time, exp in local timezone
t
,
tz
=
time
(),
self
.
_localzone
yr
,
mo
,
dy
,
hr
,
mn
,
sc
=
gmtime
(
int
(
t
))[:
6
]
sc
=
sc
+
(
t
-
int
(
t
))
s
=
(
hr
/
24.0
+
mn
/
1440.0
+
sc
/
86400.0
)
d
=
(
self
.
_julianday
(
yr
,
mo
,
dy
)
-
jd1901
)
+
s
yr
,
mo
,
dy
,
hr
,
mn
,
sc
=
localtime
(
t
)[:
6
]
...
...
@@ -412,6 +413,7 @@ class DateTime:
# Current time, exp in specified timezone
t
,
tz
=
time
(),
self
.
_tzinfo
.
_zmap
[
lower
(
arg
)]
yr
,
mo
,
dy
,
hr
,
mn
,
sc
=
gmtime
(
t
)[:
6
]
sc
=
sc
+
(
t
-
int
(
t
))
s
=
(
hr
/
24.0
+
mn
/
1440.0
+
sc
/
86400.0
)
d
=
(
self
.
_julianday
(
yr
,
mo
,
dy
)
-
jd1901
)
+
s
_d
=
d
+
(
self
.
_tzinfo
[
tz
].
info
(
t
)[
0
]
/
86400.0
)
...
...
@@ -450,6 +452,7 @@ class DateTime:
# Seconds from epoch, gmt
t
,
tz
=
arg
,
self
.
_localzone
yr
,
mo
,
dy
,
hr
,
mn
,
sc
=
gmtime
(
int
(
t
))[:
6
]
sc
=
sc
+
(
t
-
int
(
t
))
s
=
(
hr
/
24.0
+
mn
/
1440.0
+
sc
/
86400.0
)
d
=
(
self
.
_julianday
(
yr
,
mo
,
dy
)
-
jd1901
)
+
s
yr
,
mo
,
dy
,
hr
,
mn
,
sc
=
localtime
(
t
)[:
6
]
...
...
@@ -485,6 +488,7 @@ class DateTime:
t
,
tz
=
args
tz
=
self
.
_tzinfo
.
_zmap
[
lower
(
tz
)]
yr
,
mo
,
dy
,
hr
,
mn
,
sc
=
gmtime
(
t
)[:
6
]
sc
=
sc
+
(
t
-
int
(
t
))
s
=
(
hr
/
24.0
+
mn
/
1440.0
+
sc
/
86400.0
)
d
=
(
self
.
_julianday
(
yr
,
mo
,
dy
)
-
jd1901
)
+
s
_d
=
d
+
(
self
.
_tzinfo
[
tz
].
info
(
t
)[
0
]
/
86400.0
)
...
...
@@ -529,7 +533,6 @@ class DateTime:
d
=
d
-
(
self
.
_tzinfo
[
tz
].
info
(
t
)[
0
]
/
86400.0
)
s
=
d
-
int
(
d
)
t
=
(
d
*
86400.0
)
-
EPOCH
else
:
# Explicit format
yr
,
mo
,
dy
=
args
[:
3
]
...
...
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