Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bffbefd9
Commit
bffbefd9
authored
Oct 08, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timezone support for macintosh (Jack)
parent
76964c6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
Modules/timemodule.c
Modules/timemodule.c
+36
-0
No files found.
Modules/timemodule.c
View file @
bffbefd9
...
...
@@ -89,6 +89,37 @@ extern int ftime();
static
int
floatsleep
Py_PROTO
((
double
));
static
double
floattime
Py_PROTO
(());
#ifdef macintosh
/* Our own timezone. We have enough information to deduce whether
** DST is on currently, but unfortunately we cannot put it to good
** use because we don't know the rules (and that is needed to have
** localtime() return correct tm_isdst values for times other than
** the current time. So, we cop out and only tell the user the current
** timezone.
*/
static
long
timezone
;
static
void
initmactimezone
()
{
MachineLocation
loc
;
long
delta
;
ReadLocation
(
&
loc
);
if
(
loc
.
latitude
==
0
&&
loc
.
longitude
==
0
&&
loc
.
u
.
gmtDelta
==
0
)
return
;
delta
=
loc
.
u
.
gmtDelta
&
0x00FFFFFF
;
if
(
delta
&
0x00800000
)
delta
|=
0xFF000000
;
timezone
=
-
delta
;
}
#endif
/* macintosh */
static
PyObject
*
time_time
(
self
,
args
)
PyObject
*
self
;
...
...
@@ -430,6 +461,11 @@ inittime()
ins
(
d
,
"tzname"
,
Py_BuildValue
(
"(zz)"
,
wintername
,
summername
));
}
#else
#ifdef macintosh
initmactimezone
();
ins
(
d
,
"timezone"
,
PyInt_FromLong
(
timezone
));
#endif
/* macintosh */
#endif
/* HAVE_TM_ZONE */
#endif
/* !HAVE_TZNAME */
if
(
PyErr_Occurred
())
...
...
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