This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Move gmtime function from calendar to time module
Type: enhancement Stage:
Components: None Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: akuchling, brett.cannon, erl, nnorwitz, rhettinger, tim.peters
Priority: normal Keywords:

Created on 2003-03-05 13:40 by erl, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Messages (9)
msg53794 - (view) Author: Erland Lewin (erl) Date: 2003-03-05 13:40
The gmtime function in the calendar module would be
much more logical to have in the time module, since it
manipulates tm tuples and unix timestamps, which the
other functions in time do, but no other functions in
calendar.

Related to bug #697983
msg53795 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-05-22 21:46
Logged In: YES 
user_id=33168

The gmtime function is in time, not calendar.  Did you mean
the opposite that you believe gmtime should be in calendar?
  gmtime comes from the C version which is the purpose of
time, to expose C functions.
msg53796 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2003-05-23 04:47
Logged In: YES 
user_id=31435

I expect the OP meant the calendar.timegm() function.
msg53797 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-05-29 01:50
Logged In: YES 
user_id=357491

OK, assuming the OP meant calendar.timegm , doesn't time.mktime provide 
the same functionality?  Or is the desire to have it because  it specifies the 
epoch as 1970-01-01?
msg53798 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2003-05-29 02:59
Logged In: YES 
user_id=31435

mktime() interprets its argument as local time; timegm() as 
UTC.  Generally speaking,

time.mktime(time.localtime())

returns int(time.time()), and so does

calendar.timegm(time.gmtime())

The OP appears to be right that the time module doesn't 
have an "inverse" for time.gmtime() in this sense.  Then 
again, the time functions inherited from C are generally a 
twisted thicket.
msg53799 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-05-29 16:22
Logged In: YES 
user_id=357491

Well then, is there any desire to bother to make this happen?  Or is this just 
a "I hope someone likes this idea enough to implement it" instance in which 
case this should probably be made an RFE.
msg53800 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2003-06-13 00:49
Logged In: YES 
user_id=31435

Sorry, I don't have time to give to this.  It's certainly not a 
bug report <wink>.
msg53801 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-06-28 06:36
Logged In: YES 
user_id=80475

Erland, I propose that you close this one.

The time and calendar API's have been around for a good 
while and changes would have a negative impact, even if 
they have some logic to it.

The new datetime module for Py2.3 makes the time module 
obsolete; is organized logically; and should meet most of 
your needs.
msg53802 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-11-10 14:52
Logged In: YES 
user_id=11375

Closing per Tim's suggestion.
History
Date User Action Args
2022-04-10 16:07:22adminsetgithub: 38103
2003-03-05 13:40:14erlcreate