Daylight saving time question
kyosohma at gmail.com
kyosohma at gmail.com
Tue Mar 20 16:05:51 EDT 2007
On Mar 20, 2:53 pm, Mr Pekka Niiranen <pekka.niira... at pp5.inet.fi>
wrote:
> Hi,
>
> is it possible to get the two annual daylight saving times
> (day, month and time) from Python by giving location
> in some country/location string ("Europe/Finland" for example).
>
> I need to ask country in program and calculate daylight
> saving times for the next few years onwards somehow like this:
>
> for y in range(2007, 2017):
> (m1,d1,t1,m2,d2,t2) = daylight_change_epochs("Finland")
>
> -pekka-
I recommend you read this article about using the dateutil module:
http://labix.org/python-dateutil
I can't remember, but I think this one might have a slightly more
restrictive license than other modules. Be sure to check that as well.
The "tzoffset type" is probably what you need
Mike
More information about the Python-list
mailing list