import time
import calendar


def utc2timestamp(utc_datetime=None):
    """
    Convert utc datetime to seconds since epoch (UTC)
    """
    if utc_datetime is None:
        return int(time.time())
    return calendar.timegm(utc_datetime.utctimetuple())