gpg: failed to create temporary file '/var/lib/lurker/.#lk0x570d7100.hantslug.org.uk.11125': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: verify signatures failed: Unknown system error
Keith Edmunds wrote:
>
> I'm looking for a way to write a function (ideally in Python) that takes
> one parameter, a datetime, and returns a Boolean which is true if the
> passed datetime is during "daylight saving time" and is false otherwise.
Look at the pytz and datetime modules. I'm no Python guru, but the
following appears to do the job:
##################
#!/usr/bin/python
from datetime import datetime
import pytz
utc_date = datetime(2008, 04, 3, 10, 00, 00, tzinfo=pytz.utc)
local_date = utc_date.astimezone(pytz.timezone('Europe/London'))
if local_date.dst().seconds != 0:
print "Date is DST"
###################
This assumes that the input dates are always in UTC. If the input dates
are local, or mixed, it will give accurate results except for datetimes
that fall within the few hours of the clocks changing.
Chris
--
Chris Smith <cjs94@???>