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
b8da5880
Commit
b8da5880
authored
Aug 03, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a contributed odd-hour timezone patch.
parent
c6505278
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
lib/python/DateTime/DateTime.py
lib/python/DateTime/DateTime.py
+19
-6
lib/python/DateTime/DateTimeZone.py
lib/python/DateTime/DateTimeZone.py
+2
-1
No files found.
lib/python/DateTime/DateTime.py
View file @
b8da5880
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
##############################################################################
##############################################################################
"""Encapsulation of date/time values"""
"""Encapsulation of date/time values"""
__version__
=
'$Revision: 1.
39
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
40
$'
[
11
:
-
2
]
import
sys
,
os
,
math
,
regex
,
ts_regex
,
DateTimeZone
import
sys
,
os
,
math
,
regex
,
ts_regex
,
DateTimeZone
...
@@ -187,6 +187,13 @@ class _cache:
...
@@ -187,6 +187,13 @@ class _cache:
_zmap={'
aest
':'
GMT
+
1000
', '
aedt
':'
GMT
+
1100
',
_zmap={'
aest
':'
GMT
+
1000
', '
aedt
':'
GMT
+
1100
',
'
aus
eastern
standard
time
':'
GMT
+
1000
',
'
aus
eastern
standard
time
':'
GMT
+
1000
',
'
sydney
standard
time
':'
GMT
+
1000
',
'
tasmania
standard
time
':'
GMT
+
1000
',
'
e
.
australia
standard
time
':'
GMT
+
1000
',
'
aus
central
standard
time
':'
GMT
+
0930
',
'
cen
.
australia
standard
time
':'
GMT
+
0930
',
'
w
.
australia
standard
time
':'
GMT
+
0800
',
'
brazil
/
acre
':'
Brazil
/
Acre
',
'
brazil
/
acre
':'
Brazil
/
Acre
',
'
brazil
/
denoronha
':'
Brazil
/
Denoronha
',
'
brazil
/
denoronha
':'
Brazil
/
Denoronha
',
'
brazil
/
east
':'
Brazil
/
East
','
brazil
/
west
':'
Brazil
/
West
',
'
brazil
/
east
':'
Brazil
/
East
','
brazil
/
west
':'
Brazil
/
West
',
...
@@ -208,6 +215,9 @@ class _cache:
...
@@ -208,6 +215,9 @@ class _cache:
'
pacific
standard
time
':'
US
/
Pacific
',
'
pacific
standard
time
':'
US
/
Pacific
',
'
gb
-
eire
':'
GB
-
Eire
','
gmt
':'
GMT
',
'
gb
-
eire
':'
GB
-
Eire
','
gmt
':'
GMT
',
'
gmt
+
0000
':'
GMT
+
0
', '
gmt
+
0
':'
GMT
+
0
',
'
gmt
+
0930
':'
GMT
+
0930
',
'
gmt
+
0100
':'
GMT
+
1
', '
gmt
+
0200
':'
GMT
+
2
', '
gmt
+
0300
':'
GMT
+
3
',
'
gmt
+
0100
':'
GMT
+
1
', '
gmt
+
0200
':'
GMT
+
2
', '
gmt
+
0300
':'
GMT
+
3
',
'
gmt
+
0400
':'
GMT
+
4
', '
gmt
+
0500
':'
GMT
+
5
', '
gmt
+
0600
':'
GMT
+
6
',
'
gmt
+
0400
':'
GMT
+
4
', '
gmt
+
0500
':'
GMT
+
5
', '
gmt
+
0600
':'
GMT
+
6
',
'
gmt
+
0700
':'
GMT
+
7
', '
gmt
+
0800
':'
GMT
+
8
', '
gmt
+
0900
':'
GMT
+
9
',
'
gmt
+
0700
':'
GMT
+
7
', '
gmt
+
0800
':'
GMT
+
8
', '
gmt
+
0900
':'
GMT
+
9
',
...
@@ -681,11 +691,14 @@ class DateTime:
...
@@ -681,11 +691,14 @@ class DateTime:
except:
except:
try:
try:
t=time()
t=time()
localzone=mktime(gmtime(t))-t
localzone=float(int(mktime(gmtime(t))) - int(t))
localzone=int(round(-localzone/(60*60)))
offset=(-localzone/(60*60))
if localzone >= 0:
majorOffset=int(offset)
lz='
+%
d
' % localzone
if majorOffset != 0 :
else: lz=str(localzone)
minorOffset=abs(int((offset % majorOffset) * 60.0))
else: minorOffset = 0
m=majorOffset >= 0 and '
+
' or ''
lz='
%
s
%
0.02
d
%
0.02
d
' % (m, majorOffset, minorOffset)
_localzone=_cache._zmap[lower('
GMT
%
s
' % lz)]
_localzone=_cache._zmap[lower('
GMT
%
s
' % lz)]
except: _localzone=''
except: _localzone=''
...
...
lib/python/DateTime/DateTimeZone.py
View file @
b8da5880
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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