[Tutor] incrementing one minute

Dave Angel davea at ieee.org
Tue Mar 31 15:29:49 CEST 2009


Sorry for the bad assumption.  But the thread "Caught out by daylight 
saving :-(" on  the python-list was very similar, differing mainly by 
the fact he's incrementing by 5 minutes instead of 1.

Did my suggested function replacements work for you?  They did here.

po yo wrote:
> I am trying to filter Open Street Map nodes from
>
> http://planet.openstreetmap.org/minute/
>
> ... into wikimark up for Yellowikis (http://www.yellowikis.org)
>
>  I work from home - but this isn't a homework assignment. :-)
>
> Paul Y
>
> On Mon, Mar 30, 2009 at 5:52 PM, Dave Angel <davea at ieee.org> wrote:
>   
>> This is the second post I've seen on this homework assignment. ?You might
>> look at the Python List for other ideas.
>>
>> mktime() and gmtime() are not inverses of each other. ?The first assumes
>> local time, and the latter gmt (or utc). ?So unless you happen to be in
>> England, and not in daylight savings time, you'd expect a problem.
>>
>> mktime() is documented as the inverse of localtime(), according to the docs.
>> ?I'd assume they'd both make the same time adjustments for your location.
>> ?However, there's some ambiguity if the time you're looking at is in
>> standard time, while you're currently in daylight savings. ?So I'd look for
>> an answer that only used UTC (or Greenwich Mean time).
>>
>> Try time.gmtime(), and calendar.timegm()
>>
>>     



More information about the Tutor mailing list