[Python-bugs-list] [ python-Feature Requests-414029 ] Request for time.standardtime(secs)

noreply@sourceforge.net noreply@sourceforge.net
Tue, 17 Dec 2002 05:22:36 -0800


Feature Requests item #414029, was opened at 2001-04-05 11:38
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=414029&group_id=5470

Category: Extension Modules
Group: None
Status: Open
>Resolution: Fixed
Priority: 5
Submitted By: Tim Cera (timcera)
>Assigned to: Neal Norwitz (nnorwitz)
Summary: Request for time.standardtime(secs)

Initial Comment:
The time.localtime(secs) function always sets the dst
flag to 1 and applies daylight savings time for that
time zone.  There isn't an easy way to get 'standard'
time.  A time.standardtime(secs) function would not
apply the daylight savings time correction, set the dst
flag to 0 (or -1?), but would correct for time zone
difference from UTC. 

thanks
tim cera

----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-12-17 08:22

Message:
Logged In: YES 
user_id=33168

Tim Cera, I will close this in about a month unless you can
provide clarification.  

I believe there may have been some issues with the DST flag
in earlier versions of Python.  However, these have been
fixed.  Also, with the new Date & Time classes Tim has added
for Python 2.3, these should provide the functionality you want.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2002-12-16 23:26

Message:
Logged In: YES 
user_id=31435

Unassigned this.  I don't know what Tim Cera is asking for, 
so I suggest we close this unless clarification is forthcoming.

>>> import time
>>> time.localtime(time.time())
(2002, 12, 16, 23, 21, 36, 0, 350, 0)
>>> _.tm_isdst
0
>>>

That is, it's not true that time.localtime() always sets 
tm_isdst to 1, nor is it true that it always applies a DST 
adjustment.  Perhaps he has a platform bug, but we don't 
know which platform, or version of Python, he's talking 
about.

On top of all that, I've no idea what "standard time" means 
in this context.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-12-16 23:11

Message:
Logged In: YES 
user_id=33168

Tim (Peters), here's another date/time one.  This seems to
already work for time.gmtime() which returns 0 for tm_isdst.
 Can this be closed?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=414029&group_id=5470