~unity-2d-team/unity-2d/Shell-MultiMonitor

« back to all changes in this revision

Viewing changes to grackle/model.py

  • Committer: William Grant
  • Date: 2012-01-23 05:57:50 UTC
  • Revision ID: william.grant@canonical.com-20120123055750-veg4p0rv3fnef9z3
So it turns out that calendar.timegm is a UTC equivalent of time.mktime.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# License along with this program. If not, see
15
15
# <http://www.gnu.org/licenses/>.
16
16
 
 
17
import calendar
17
18
import datetime
18
19
import dateutil.tz
19
20
import email.parser
20
21
from email.utils import parsedate_tz
21
22
import functools
22
23
import logging
23
 
import time
24
24
import uuid
25
25
 
26
26
import pycassa
86
86
 
87
87
 
88
88
def _utc_timestamp(dt):
89
 
    return time.mktime(_utc_datetime(dt).timetuple()) - time.timezone
 
89
    return calendar.timegm(_utc_datetime(dt).timetuple())
90
90
 
91
91
 
92
92
def _utc_timeuuid(dt, lowest_val=True):