def epoch(dt):
    return calendar.timegm(dt.astimezone(pytz.utc).timetuple())
Returns the epoch timestamp of a timezone-aware datetime object.
dataset/ETHPy150Open brutasse/graphite-api/graphite_api/utils.py/epoch