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.

Author akira
Recipients akira, regu0004, terry.reedy
Date 2014-09-01.09:17:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1409563025.93.0.00957645105775.issue22296@psf.upfronthosting.co.za>
In-reply-to
Content
time.time() returns the current time in seconds since Epoch
it is neither local nor UTC time. It can be converted to both.

You can get local time using datetime.fromtimestamp(ts).
You can get UTC time using datetime.utcfromtimestamp(ts) or
to get an aware datetime object: datetime.fromtimestamp(ts, timezone.utc), where ts is the timestamp in seconds since Epoch.

I don't know whether there is an issue with cookie.is_expired() but it
is incorrect to use time.mktime() with UTC time tuple unless the local
time is UTC. To get the timestamp from a datetime object, you could
use .timestamp() method instead:

  from datetime import datetime, timezone

  now = datetime.now(timezone.utc) # the current time
  seconds_since_epoch = now.timestamp()
  seconds_since_epoch = time.time() # might be less precise
History
Date User Action Args
2014-09-01 09:17:06akirasetrecipients: + akira, terry.reedy, regu0004
2014-09-01 09:17:05akirasetmessageid: <1409563025.93.0.00957645105775.issue22296@psf.upfronthosting.co.za>
2014-09-01 09:17:05akiralinkissue22296 messages
2014-09-01 09:17:05akiracreate